in reply to Improve foreach with help of map?
my ($result) = map /(something)/, split /\n/, $content;
Of course, map can probably easily be avoided by using the following
my ($result) = $content =~ /(something)/;
It might require small changes to the regex pattern, though
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Improve foreach with help of map?
by mickep76 (Beadle) on Oct 09, 2009 at 14:53 UTC | |
by ikegami (Patriarch) on Oct 09, 2009 at 15:18 UTC | |
by mickep76 (Beadle) on Oct 09, 2009 at 15:27 UTC |