This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #20444] regex not evaluated in constant ?:
authorFather Chrysostomos <sprout@cpan.org>
Tue, 21 Sep 2010 05:05:34 +0000 (22:05 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 21 Sep 2010 05:05:34 +0000 (22:05 -0700)
commit2474a784a94d8c70aea9c330d9f2a902b8a68b85
treeb09595a0bb76d458489b7aee6fef31f7286c1c9e
parentaf9838cc2fa3350e15e88a27008899ae3a3afdb6
[perl #20444] regex not evaluated in constant ?:

  $text =~ ( 1 ? /phoo/ : /bear/)

used to be constant-folded to

  $text =~ /phoo/

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.
op.c
op.h
t/comp/fold.t