list
foreach ITEM (LIST) {BLOCK}
my - in the foreach loop
Example 7-1. examples/arrays/list_colors.pl
#!/usr/bin/perl
use strict;
use warnings;
foreach my $color ("Blue", "Yellow", "Brown", "White") {
print "$color\n";
}
Blue
Yellow
Brown
White
| Prev | Home (Copyright Gabor Szabo) Perl Training Israel | Next |
| List Assignment | Up | Create an Array, loop over with foreach |