On Fri, Dec 24, 2004 at 08:43:56AM -0600, JupiterHost.Net wrote:

> Interesting, here's a couple benchmarks for for() vs. map():
> 
> for - print "$_\n" for grep length($_) <= 3, @ARGV
> map - map "$_\n", grep length() <= 3, @ARGV

You don't show your benchmark code or mention which version of perl you
are testing with so it's hard to say exactly what is going on here.  map
in void context was recently optimised so that it wouldn't create the
return list, but such use is still generally considered poor style.

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to