This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
force recompiling of regex where closures matter
There are some cases where on the second run of a run-time regex, the
text of the pattern hasn't changed, but we should still recompile to
ensure that closure behaviour is correct.
These cases are:
1) run-time code:
my $code = '(??{$x})';
for my $x (1..3) {
$x =~ /$code/; # recompile to see fresh value of $x
}
2) embedded regexes with code:
for my $x (1..3) {
my $r = qr/(??{$x})/;
"A$x" =~ /A$r/; # recompile to see new $r
}
With this fix, all the TODO tests in re/pat_re_eval.t now pass. (Note that
a couple of those TODO tests were actually broken and are fixed in this
commit)