Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

using map and swap (aka substitute)

by DamianKaelGreen (Acolyte)
on Jan 14, 2013 at 20:18 UTC ( [id://1013266]=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @list= qw(first_string second_string);
    @list = map(s/_string$//,@list);
    print @list;
    
  2. or download this
    my @list= qw(first_string second_string);
    @list = map((s/_string$// and $_), @list);
    print @list;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2024-04-25 19:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found