Tutorial by Examples

Perl supports many kinds of conditional statements (statements that are based on boolean results). The most common conditional statements are if-else, unless, and ternary statements. given statements are introduced as a switch-like construct from C-derived languages and are available in versions Per...
Perl supports many kinds of loop constructs: for/foreach, while/do-while, and until. @numbers = 1..42; for (my $i=0; $i <= $#numbers; $i++) { print "$numbers[$i]\n"; } #Can also be written as foreach my $num (@numbers) { print "$num\n"; } The while loop ev...

Page 1 of 1