use Benchmark qw( cmpthese ); $i=0; sub blah1 { my @list = qw(# list of things); foreach my $item (@list) { $i++; } } { my @list; BEGIN { @list = qw(# list of things); } sub blah2 { foreach my $item (@list) { $i++; } } } sub blah3 { foreach my $item qw(# list of things) { $i++; } } cmpthese(0, { blah1 => \&blah1, blah2 => \&blah2, blah3 => \&blah3, }); __END__ (partial) output ================ Rate blah1 blah2 blah3 blah1 118024/s -- -52% -53% blah2 245479/s 108% -- -1% blah3 248532/s 111% 1% --