Welcome to the Monastery | |
PerlMonks |
Re^3: Count and List Items in a Listby Tanktalus (Canon) |
on Nov 01, 2005 at 17:51 UTC ( [id://504671]=note: print w/replies, xml ) | Need Help?? |
That said, I always prefer code that does what it says and says what it does. To me, for/foreach evaluates code foreach element in a list, while map maps (or transforms) one list into another. If you want to iterate over a list, use for or foreach. If you want to transform from one list to another, use map.
In Section
Seekers of Perl Wisdom
|
|