in reply to Assign result of map to scalar variable
my ($val) = map { /^\*\s\(?([^\)]+)\)?/} @GET_STRING; # Or (as others have suggested) my ($val) = map { /^\*\s\(?([^\)]+)\)?/ ? $1 : () } @GET_STRING;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Assign result of map to scalar variable
by AnomalousMonk (Archbishop) on Jul 18, 2013 at 21:08 UTC |