Change 33311 by [EMAIL PROTECTED] on 2008/02/14 16:30:32
Subject: Re: [perl #50706] %^H affecting outside file scopes
From: Rick Delaney <[EMAIL PROTECTED]>
Date: Tue, 12 Feb 2008 14:05:22 -0500
Message-ID: <[EMAIL PROTECTED]>
Affected files ...
... //depot/perl/pp_ctl.c#685 edit
... //depot/perl/t/lib/Sans_mypragma.pm#1 add
... //depot/perl/t/lib/mypragma.t#5 edit
Differences ...
==== //depot/perl/pp_ctl.c#685 (text) ====
Index: perl/pp_ctl.c
--- perl/pp_ctl.c#684~33291~ 2008-02-12 05:15:20.000000000 -0800
+++ perl/pp_ctl.c 2008-02-14 08:30:32.000000000 -0800
@@ -3564,6 +3564,8 @@
SAVEHINTS();
PL_hints = 0;
+ PL_compiling.cop_hints_hash = NULL;
+
SAVECOMPILEWARNINGS();
if (PL_dowarn & G_WARN_ALL_ON)
PL_compiling.cop_warnings = pWARN_ALL ;
==== //depot/perl/t/lib/Sans_mypragma.pm#1 (text) ====
Index: perl/t/lib/Sans_mypragma.pm
--- /dev/null 2008-02-14 07:05:46.549730428 -0800
+++ perl/t/lib/Sans_mypragma.pm 2008-02-14 08:30:32.000000000 -0800
@@ -0,0 +1,7 @@
+package Sans_mypragma;
+
+sub affected {
+ mypragma::in_effect();
+}
+
+1;
==== //depot/perl/t/lib/mypragma.t#5 (text) ====
Index: perl/t/lib/mypragma.t
--- perl/t/lib/mypragma.t#4~29475~ 2006-12-06 04:51:34.000000000 -0800
+++ perl/t/lib/mypragma.t 2008-02-14 08:30:32.000000000 -0800
@@ -7,7 +7,7 @@
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 @@
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 $@;
End of Patch.