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
Follow me: