Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
No such thing as a small change
 
PerlMonks  

Re^8: modify the contents of an array

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

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


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
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.