Your skill will accomplish what the force of many cannot |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Picking your syntax based on benchmarks of trivial operations is total folly. Use map if you want to get back a list. Don't otherwise. Now, there can be non-trivial performance implications in similar syntax choices between for() and while() when reading from a (large) file, for example. But you also likely would not discover those from running benchmarks of trivial operations. The benchmark results presented so far mostly illustrate differences in the trivial operations being done, not any performance difference that is likely to actually matter if you were changing useful code between map/for() [for cases of code where for() made sense]. - tye In reply to Re: map vs for\foreach. (perf)
by tye
|
|