# New Ticket Created by Rick Delaney
# Please include the string: [perl #50706]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=50706 >
=head1 SYNOPSIS
use mypragma;
use SomeModule; # (caller(0))[10]{mypragma} is wrongly true inside
=head1 EXAMPLES
See attached todo test.
--
Rick Delaney
r...@bort.ca
[
todo.patch 1K ]
diff -pruN perl-current/t/lib/Sans_mypragma.pm perl-current-dev/t/lib/Sans_mypragma.pm
--- perl-current/t/lib/Sans_mypragma.pm 1969-12-31 19:00:00.000000000 -0500
+++ perl-current-dev/t/lib/Sans_mypragma.pm 2008-02-10 21:10:34.000000000 -0500
@@ -0,0 +1,8 @@
+
+package Sans_mypragma;
+
+sub affected {
+ mypragma::in_effect();
+}
+
+1;
diff -pruN perl-current/t/lib/mypragma.t perl-current-dev/t/lib/mypragma.t
--- perl-current/t/lib/mypragma.t 2006-12-06 07:52:57.000000000 -0500
+++ perl-current-dev/t/lib/mypragma.t 2008-02-10 21:18:07.000000000 -0500
@@ -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,13 @@ is(mypragma::in_effect(), undef, "pragma
or die $@;
use mypragma;
+ use Sans_mypragma;
is(mypragma::in_effect(), 42, "pragma is in effect within this block");
+ TODO: {
+ local $TODO = "file scope";
+ 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 $@;