Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

A hint about using map

by doom (Deacon)
on Apr 05, 2005 at 23:17 UTC ( [id://445124]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # WRONG
    @new_list_wrong = map{ s/that idiot/our esteemed leader/ } @list;
    
  2. or download this
    @new_list_right = map{ s/that idiot/our esteemed leader/; $_ } @list;
    
  3. or download this
    # yet another way to strip leading and trailing whitespace:
    @cleaned_list = map{ m/^\s*?(\w.*?)\s*?$/ } @list;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2024-04-24 07:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found