Regexp capture group list

Uri Guttman uri at
Tue Nov 10 17:46:32 GMT 2009

>>>>> "PLE" == Paul LeoNerd Evans <leonerd at> writes:

  PLE>   substr( $_[0], 0, $+[0] ) = "";

4 arg substr is faster than lvalue substr.

	substr( $_[0], 0, $+[0], '' ) ;

i do a very similar recursive parse in Template::Simple and i also use
$1 and $2 in s/// in the basic rendering. the compiler variation does
m// and then a 4 arg substr to chop off the matched leading text. you
can see the basic code on cpan and the latest unreleased version with
the compiler code at:

there also may be a way to use \G in the regex to start parsing from
where you last parsed. i couldn't get that to work but maybe ask damian
for help. :)


Uri Guttman  ------  uri at  -------- --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ---- ---------

More information about the mailing list