Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: tr/// on a list

by GrandFather (Saint)
on Sep 14, 2007 at 22:37 UTC ( [id://639098]=note: print w/replies, xml ) Need Help??


in reply to Re: tr/// on a list
in thread tr/// on a list

Because map operates on an alias of each element you don't need to assign the result of the map anywhere:

map {$_= lc} @beatles;

However map in a void context is frowned on so it would be more usual to use for/foreach as a statement modifier:

$_ = lc for @beatles;

DWIM is Perl's answer to Gödel

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://639098]
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: (7)
As of 2024-04-23 15:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found