loop over elements of list with foreach



examples/perlarrays/list_colors.pl
#!/usr/bin/perl
use strict;
use warnings;

foreach my $color ("Blue", "Yellow", "Brown", "White") {
    print "$color\n";
}



Blue
Yellow
Brown
White