"be consistent" | |
PerlMonks |
Re: map vs for\foreach.by stevieb (Canon) |
on Mar 11, 2015 at 14:22 UTC ( [id://1119635]=note: print w/replies, xml ) | Need Help?? |
map() is a very powerful transformation tool. If I see map() in code, I know the intent of the code is to do something with each element of the structure passed in. That's not always as easy to spot in a for() loop. Besides, most map() work is contained on a single line, therefore making the code easier to understand at a glance. Just my $.02. -Steve
In Section
Seekers of Perl Wisdom
|
|