# case 1 sub blah { ... my @list = qw(# list of things); foreach my $item (@list) { ... } # case 2 { my @list; BEGIN { @list = qw(# list of things); } sub blah { ... foreach my $item (@list) { ... } } # case 3 sub blah { ... foreach my $item qw(# list of things) { ... }