>>>>> "PLE" == Paul LeoNerd Evans <leon...@leonerd.org.uk> 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:

        http://perlhunter.com/git/template
        http://perlhunter.com/git/gitweb/gitweb.cgi

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

-- 
Uri Guttman  ------  u...@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------

Reply via email to