Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^3: cool way of manipulating array elements

by PrakashK (Pilgrim)
on Sep 13, 2011 at 20:29 UTC ( #925767=note: print w/ replies, xml ) Need Help??


in reply to Re^2: cool way of manipulating array elements
in thread cool way of manipulating array elements

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.


Comment on Re^3: cool way of manipulating array elements
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2014-11-26 12:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (171 votes), past polls