From: Rafael Garcia-Suarez Date: Mon, 23 Feb 2004 20:56:38 +0000 (+0000) Subject: Fix bug #26910: hints were not propagated into (?{...}) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=35d904946636411814f392bec019cad90a357c0a;p=p5sagit%2Fp5-mst-13.2.git Fix bug #26910: hints were not propagated into (?{...}) blocks, except the utf8 pragma. p4raw-id: //depot/perl@22364 --- diff --git a/pp_ctl.c b/pp_ctl.c index c5f802a..e91ff54 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -2714,7 +2714,6 @@ Perl_sv_compile_2op(pTHX_ SV *sv, OP** startop, char *code, PAD** padp) #else SAVEVPTR(PL_op); #endif - PL_hints &= HINT_UTF8; /* we get here either during compilation, or via pp_regcomp at runtime */ runtime = IN_PERL_RUNTIME; diff --git a/t/lib/strict/refs b/t/lib/strict/refs index 10599b0..b6a2753 100644 --- a/t/lib/strict/refs +++ b/t/lib/strict/refs @@ -295,3 +295,9 @@ eval ' my $a = ${"Fred"} ; EXPECT Can't use string ("Fred") as a SCALAR ref while "strict refs" in use at - line 8. +######## +# [perl #26910] hints not propagated into (?{...}) +use strict 'refs'; +/(?{${"foo"}++})/; +EXPECT +Can't use string ("foo") as a SCALAR ref while "strict refs" in use at (re_eval 1) line 1. diff --git a/t/lib/strict/subs b/t/lib/strict/subs index 6cf988c..4f0e621 100644 --- a/t/lib/strict/subs +++ b/t/lib/strict/subs @@ -373,3 +373,10 @@ print "" if BAREWORD; EXPECT Bareword "BAREWORD" not allowed while "strict subs" in use at - line 3. Execution of - aborted due to compilation errors. +######## +# [perl #26910] hints not propagated into (?{...}) +use strict 'subs'; +qr/(?{my $x=foo})/; +EXPECT +Bareword "foo" not allowed while "strict subs" in use at (re_eval 1) line 1. +Compilation failed in regexp at - line 3. diff --git a/t/lib/strict/vars b/t/lib/strict/vars index ab24c9d..e482831 100644 --- a/t/lib/strict/vars +++ b/t/lib/strict/vars @@ -430,3 +430,10 @@ EXPECT Global symbol "@k" requires explicit package name at - line 4. Global symbol "$k" requires explicit package name at - line 4. Execution of - aborted due to compilation errors. +######## +# [perl #26910] hints not propagated into (?{...}) +use strict 'vars'; +qr/(?{$foo++})/; +EXPECT +Global symbol "$foo" requires explicit package name at (re_eval 1) line 1. +Compilation failed in regexp at - line 3.