This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Disable PL_sawampersand
authorFather Chrysostomos <sprout@cpan.org>
Sun, 25 Nov 2012 20:57:04 +0000 (12:57 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 27 Nov 2012 15:05:02 +0000 (07:05 -0800)
commit1a904fc88069e249a4bd0ef196a3f1a7f549e0fe
treede28df537caeee6b88185d7beb1305d5b8b55dfb
parent07d01d6ec25527bf0236de2205ea412d40353058
Disable PL_sawampersand

PL_sawampersand actually causes bugs (e.g., perl #4289), because the
behaviour changes.  eval '$&' after a match will produce different
results depending on whether $& was seen before the match.

Using copy-on-write for the pre-match copy (preceding patches do that)
alleviates the slowdown caused by mentioning $&.  The copy doesn’t
happen unless the string is modified after the match.  It’s now a
post- match copy.  So we no longer need to do things differently
depending on whether $& has been seen.

PL_sawampersand is now #defined to be equal to what it would be if
every program began with $',$&,$`.

I left the PL_sawampersand code in place, in case this commit proves
immature.  Running Configure with -Accflags=PERL_SAWAMPERSAND will
reënable the PL_sawampersand mechanism.
embedvar.h
gv.c
intrpvar.h
makedef.pl
perl.c
perl.h
regen/embed.pl
sv.c