in reply to pattern matching and return values
To store them in a hash,use a hash slice to assign them:if( my($a, $c) = $string =~ /(a).*(c)/ ) { print "a=$a c=$c\n"; }
@result{"a","b"} = $string =~ /(a).*(c)/;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: pattern matching and return values
by Anonymous Monk on Jul 18, 2004 at 05:32 UTC |