#! perl use Benchmark; @junk = cat /etc/motd; $count=10_000; timethese($count, { 'map' =>sub {my @a=@junk; map {s/a/b } @a; return @a }, 'for' =>sub {my @a=@junk; for (@a) { s/a/b/}; return @a}, }); "my $var = defined()";