Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: Count and List Items in a List

by Tanktalus (Canon)
on Nov 01, 2005 at 17:51 UTC ( #504671=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Count and List Items in a List
in thread Count and List Items in a List

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.


Comment on Re^3: Count and List Items in a List
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://504671]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (8)
As of 2014-08-21 18:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (141 votes), past polls