nayakgi / perl-compiler

Automatically exported from code.google.com/p/perl-compiler
Other
0 stars 0 forks source link

re-eval (?{ }) lex/global mixup #329

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

> perlcc -r -e '$_ = q{aaa}; my @res; pos = 1; s/\Ga(?{push @res, $_, 
$`})/xx/g; print "ok\n" if "$_ @res" eq "axxxx aaa a aaa aa"; print "$_ @res\n"'
axxxx

nothing is pushed to @res

What is the expected output? What do you see instead?

> perl -e '$_ = q{aaa}; my @res; pos = 1; s/\Ga(?{push @res, $_, $`})/xx/g; 
print "ok\n" if "$_ @res" eq "axxxx aaa a aaa aa"; print "$_ @res\n"'
ok
axxxx aaa a aaa aa

Please use labels and text to provide additional information.

Original issue reported on code.google.com by nicolas....@gmail.com on 9 May 2014 at 9:08

GoogleCodeExporter commented 9 years ago
might be same as issue 328

Original comment by todd.e.rinaldo on 9 May 2014 at 9:10

GoogleCodeExporter commented 9 years ago
generic re exec via /e is tested in testc.sh 3

New style re eval (?{  }) not yet supported (and generally discouraged since it 
fails with older perls < 5.18)

Original comment by reini.urban on 9 May 2014 at 11:18

GoogleCodeExporter commented 9 years ago
It is pushed to the wrong @res variable caused by the broken upstream re_eval 
compiler Perl_sv_compile_2op_is_broken(), pp_ctl.c:3075

Original comment by reini.urban on 3 Jun 2014 at 3:26