in reply to Re^3: non aliased default var $_
in thread non aliased default var $_
I'm meditating more about orthogonal code than speed.
But you are really measuring strange things on your sytsem
lanx@ubuntu:~$ perl -MTime::HiRes=time -e'my @a= 0..1e6;my $t= time;my + @bla=@a; tr/h//d for @bla;print time-$t; <>' 2.48298692703247 lanx@ubuntu:~$ perl -MTime::HiRes=time -e'my @a= 0..1e6;my $t= time;my + @bla= map{tr/h//d; $_} @{\@a};print time-$t; <>' 7.50910615921021 lanx@ubuntu:~$ perl -MTime::HiRes=time -e'my @a= 0..1e6;my $t= time;my + @bla= map{tr/h//d; $_}map{$_} @a;print time-$t; <>' 8.25657296180725
Cheers Rolf
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: non aliased default var $_
by BrowserUk (Patriarch) on Mar 10, 2010 at 13:46 UTC |