Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: Double interpolation of captured substrings

by Fletch (Bishop)
on Nov 17, 2004 at 16:59 UTC ( [id://408474] : note . print w/replies, xml ) Need Help??


in reply to Re: Double interpolation of captured substrings
in thread Double interpolation of captured substrings

You could also allow for referencing the whole match as 0 with:

$str =~ $regex; my @matches = map substr( $str, $-[$_], $+[$_] - $-[$_] ), 0..$#-;