Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: using map and swap (aka substitute)

by AnomalousMonk (Archbishop)
on Jan 14, 2013 at 21:40 UTC ( [id://1013284]=note: 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$// and $_), @list);
    print @list;
    
  2. or download this
    >perl -wMstrict -le
    "my @list= qw(first_string  second_string  THIRD  fourth_string);
    ...
     printf qq{'$_'  } for @list;
    "
    'first'  'second'  ''  'fourth'
    

Log In?
Username:
Password:

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

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

    No recent polls found