summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-11-25 12:57:04 -0800
committerFather Chrysostomos <sprout@cpan.org>2012-11-27 07:05:02 -0800
commit1a904fc88069e249a4bd0ef196a3f1a7f549e0fe (patch)
treede28df537caeee6b88185d7beb1305d5b8b55dfb /sv.c
parent07d01d6ec25527bf0236de2205ea412d40353058 (diff)
downloadperl-1a904fc88069e249a4bd0ef196a3f1a7f549e0fe.tar.gz
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.
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sv.c b/sv.c
index 6a700e6ff8..d8d0ff8add 100644
--- a/sv.c
+++ b/sv.c
@@ -13057,7 +13057,9 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
PL_minus_F = proto_perl->Iminus_F;
PL_doswitches = proto_perl->Idoswitches;
PL_dowarn = proto_perl->Idowarn;
+#ifdef PERL_SAWAMPERSAND
PL_sawampersand = proto_perl->Isawampersand;
+#endif
PL_unsafe = proto_perl->Iunsafe;
PL_perldb = proto_perl->Iperldb;
PL_perl_destruct_level = proto_perl->Iperl_destruct_level;