in reply to Re: Is this a memory rewriting or else....!
in thread Is this a memory rewriting or else....!

Actually, in that respect, Perl's regexp engine does handle mutiple "m//g" instances properly. Witness the following code:

use strict; use warnings; use diagnostics; my( $first, $second ) = ( "a1b2c3d4e5f6", "AaBbCc" ); while( $first =~ m/(\d)/g ) { print "\$first matched on $1\n"; while( $second =~ m/([a-z])/g ) { print "\t\$second matched on $1\n"; } }

You might be thinking of this quote, from perltodo:

A re-entrant regexp engine
This will allow the use of a regex from inside (?{ }), (??{ }) and (?(?{ })|) constructs.


Dave