Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: tr/// on a list

by GrandFather (Saint)
on Sep 14, 2007 at 22:37 UTC ( #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
Node Status?
node history
Node Type: note [id://639098]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2021-01-19 18:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?