Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^8: modify the contents of an array

by nothingmuch (Priest)
on Sep 29, 2005 at 21:55 UTC ( [id://496260]=note: print w/replies, xml ) Need Help??


in reply to Re^7: modify the contents of an array
in thread modify the contents of an array

uh, seriously, wtf?
map { s/// } @array; # ... s/// for @array;
They're the same, except one is more confusing to read, because most people expect it's return type to be used.

Just because larry likes something is not a reason everyone should be following him (we should all be blindingly following Perl Best Practices instead ;-), but map in void context has no advantage over for, but does add an element of confusion (did the author mean to assign to a result array? did the author not know about for? am I reading this badly? let me go up one line and see if it's a multi line assignment statement).

Optimizing for readability is universal good style.

-nuffin
zz zZ Z Z #!perl

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-04-20 09:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found