Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
%^H affecting outside file scopes
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Rick Delaney  
View profile  
 More options Feb 10 2008, 9:38 pm
Newsgroups: perl.perl5.porters
From: perlbug-follo...@perl.org (Rick Delaney)
Date: Sun, 10 Feb 2008 18:38:02 -0800
Local: Sun, Feb 10 2008 9:38 pm
Subject: [perl #50706] %^H affecting outside file scopes

# 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 $@;


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rick Delaney  
View profile  
 More options Feb 12 2008, 2:05 pm
Newsgroups: perl.perl5.porters
From: r...@bort.ca (Rick Delaney)
Date: Tue, 12 Feb 2008 14:05:22 -0500
Local: Tues, Feb 12 2008 2:05 pm
Subject: Re: [perl #50706] %^H affecting outside file scopes
On Feb 10 2008, Rick Delaney wrote:

> # 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

The patch after my .sig fixes this and all tests pass but I'm not
confident that I completely understand the whole pragma mechanism so
please think about the ramifications that I didn't.  :-)

--
Rick Delaney
r...@bort.ca

diff -pruN perl-current/pp_ctl.c perl-current-dev/pp_ctl.c
--- perl-current/pp_ctl.c       2008-02-12 08:16:57.000000000 -0500
+++ perl-current-dev/pp_ctl.c   2008-02-12 13:52:23.000000000 -0500
@@ -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 ;


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rafael Garcia-Suarez  
View profile  
 More options Feb 14 2008, 11:31 am
Newsgroups: perl.perl5.porters
From: rgarciasua...@gmail.com (Rafael Garcia-Suarez)
Date: Thu, 14 Feb 2008 17:31:07 +0100
Local: Thurs, Feb 14 2008 11:31 am
Subject: Re: [perl #50706] %^H affecting outside file scopes
On 12/02/2008, Rick Delaney <r...@bort.ca> wrote:

> The patch after my .sig fixes this and all tests pass but I'm not
>  confident that I completely understand the whole pragma mechanism so
>  please think about the ramifications that I didn't.  :-)

I believe it's correct. Thanks, applied as #33311.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »