This is perl, v5.8.6 built for i686-linux Rate foreach map foreach 47168/s -- -2% map 48260/s 2% --
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 reply to Re^3: Count and List Items in a List
by Tanktalus
in thread Count and List Items in a List
by Tech77
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |