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

Re: [PATCH] Re: [perl #20444] regex not evaluated in constant ?:

Thread Previous
From:
Father Chrysostomos
Date:
August 1, 2010 20:12
Subject:
Re: [PATCH] Re: [perl #20444] regex not evaluated in constant ?:
Message ID:
BE380C50-EB4B-4701-9479-E975F314500E@cpan.org

On Aug 1, 2010, at 12:21 PM, Father Chrysostomos wrote:

> This patch solves the problem by marking match and subst ops as OPf_SPECIAL during constant folding, so the =~ operator can tell not to take possession of it.

With that patch:

$ ./perl -Ilib -MO=Deparse -e'"foo" =~ (1?/foo/:/bar/)'
'foo' =~ /foo/;
-e syntax OK

So the Deparse output no longer matches what perl does. With the patch attached to this message applied after that one:

$ ./perl -Ilib -MO=Deparse -e'"foo" =~ (1?/foo/:/bar/)'
'foo' =~ ($_ =~ /foo/);
-e syntax OK

Thread Previous


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