From: Rick Delaney Date: Tue, 12 Feb 2008 14:05:22 +0000 (-0500) Subject: Re: [perl #50706] %^H affecting outside file scopes X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=27eaf14c55a541e1e4f2529a8084e15a8cc43d41;p=p5sagit%2Fp5-mst-13.2.git Re: [perl #50706] %^H affecting outside file scopes Message-ID: <20080212190522.GB16896@bort.ca> p4raw-id: //depot/perl@33311 --- diff --git a/pp_ctl.c b/pp_ctl.c index 7be56fb..af08661 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -3564,6 +3564,8 @@ PP(pp_require) SAVEHINTS(); PL_hints = 0; + PL_compiling.cop_hints_hash = NULL; + SAVECOMPILEWARNINGS(); if (PL_dowarn & G_WARN_ALL_ON) PL_compiling.cop_warnings = pWARN_ALL ; diff --git a/t/lib/Sans_mypragma.pm b/t/lib/Sans_mypragma.pm new file mode 100644 index 0000000..a0b9ded --- /dev/null +++ b/t/lib/Sans_mypragma.pm @@ -0,0 +1,7 @@ +package Sans_mypragma; + +sub affected { + mypragma::in_effect(); +} + +1; diff --git a/t/lib/mypragma.t b/t/lib/mypragma.t index 48e9865..0ebd207 100644 --- a/t/lib/mypragma.t +++ b/t/lib/mypragma.t @@ -7,7 +7,7 @@ BEGIN { use strict; use warnings; -use Test::More tests => 13; +use Test::More tests => 14; use mypragma (); # don't enable this pragma yet @@ -22,7 +22,10 @@ is(mypragma::in_effect(), undef, "pragma not in effect yet"); or die $@; use mypragma; + use Sans_mypragma; is(mypragma::in_effect(), 42, "pragma is in effect within this block"); + is(Sans_mypragma::affected(), undef, + "pragma not in effect outside this file"); eval qq{is(mypragma::in_effect(), 42, "pragma is in effect within this eval"); 1} or die $@;