|
|
| P is for Practical | |
| PerlMonks |
Re^3: cool way of manipulating array elementsby PrakashK (Pilgrim) |
| on Sep 13, 2011 at 20:29 UTC ( #925767=note: print w/ replies, xml ) | Need Help?? |
|
I use map, not for its "compact syntax", but depending on the use case. This example, in my opinion, is the perfect use case for map: transform an array using some criteria and return a new array. for (or, foreach if you like) has its place, but I don't find it inherently more readable than map.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||