ray.perlling has asked for the wisdom of the Perl Monks concerning the following question:
#! 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(<STDIN>)";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: strawberry on XP
by mwah (Hermit) on May 22, 2008 at 10:42 UTC | |
|
Re: strawberry on XP
by marto (Cardinal) on May 22, 2008 at 10:49 UTC |