develooper Front page | perl.perl5.porters | Postings from August 2009

Re: [perl #68020] Evil combination of regexes, lexicals, and autovivication

Thread Previous | Thread Next
From:
John Peacock
Date:
August 3, 2009 14:11
Subject:
Re: [perl #68020] Evil combination of regexes, lexicals, and autovivication
Message ID:
4A77528E.506@havurah-software.org
Dave Mitchell wrote:
> On Wed, Jul 29, 2009 at 11:46:39AM -0700, John Peacock wrote:
>>    my $rx = qr{ (?{ @arr = [1]; $arr[-1][0] = 0; my $var; }) }x;
> 
> Any use of lexical vars within (?{...}) is currently deeply broken due to
> the braindead way it's implemented (eval the code, then keep the eval'd
> CV's body around for future use. Eveything related to pads and closures is
> then wrong).

Damian worked around it with a single s/my/local/ in Regexp::Grammars, 
so it looks like we can probably let this fester a little longer then...

John

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About