my @list= qw(first_string second_string); @list = map(s/_string$//,@list); print @list;
Returns a bunch of ones, in this case "11"
What should be done instead:
my @list= qw(first_string second_string); @list = map((s/_string$// and $_), @list); print @list;
Another similar reference can be found at: id:20505
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: using map and swap (aka substitute)
by BrowserUk (Patriarch) on Jan 14, 2013 at 20:24 UTC | |
by jwkrahn (Abbot) on Jan 14, 2013 at 22:45 UTC | |
Re: using map and swap (aka substitute)
by AnomalousMonk (Archbishop) on Jan 14, 2013 at 22:09 UTC | |
Re: using map and swap (aka substitute)
by AnomalousMonk (Archbishop) on Jan 14, 2013 at 21:40 UTC | |
Re: using map and swap (aka substitute)
by blue_cowdawg (Monsignor) on Jan 14, 2013 at 20:23 UTC |
Back to
Meditations