Skip Menu |

This queue is for tickets about the autodie CPAN distribution.

Report information
The Basics
Id: 72053
Status: resolved
Priority: 0/
Queue: autodie

People
Owner: Nobody in particular
Requestors: PMORCH [...] cpan.org
zdm [...] softvisio.net
Cc: peter [...] morch.com
AdminCc:

Bug Information
Severity: (no value)
Broken in:
  • 2.06_01
  • 2.10
Fixed in: (no value)



CC: peter [...] morch.com
Subject: "no autodie" doesn't respect lexical scope
I'm expecting: #!/usr/bin/perl use autodie; # autodie in effect here { no autodie; # autodie is not in effect here } # autodie should be in effect here because of the supposedly lexical scope # of autodie, but this doesn't die: open my $i, '<', '/nonexistent'; See http://stackoverflow.com/questions/7927139/bug-in-perls-autodie-pm for more details.
Subject: no autodie ignore scope
Date: Tue, 25 Jun 2013 02:52:45 +0300
To: bug-autodie [...] rt.cpan.org
From: zdm <zdm [...] softvisio.net>
As i correctly understand if i use "no autodie" for some code block if must be effective only for this code block lexical scope. But following code disable autodie not only for it's lexical scope but for all code below: use autodie qw(:all); { no autodie qw(open); open(my $fh, "<", "no-die.txt") || print "no-die.txt skipped\n"; } open(my $fh, "<", "die.txt") || print "die.txt skipped\n"; 1; __END__ The output: no-die.txt skipped die.txt skipped Bug detected in activeperl-5.16.3-x64 on windows-8-x64 and centos-6.4-x64.
Due to Niels' amazing efforts, we have a fix for this. I'm hoping to push a release to CPAN today or tomorrow. ~ pjf
Subject: Re: [rt.cpan.org #72053] "no autodie" doesn't respect lexical scope
Date: Mon, 19 May 2014 11:05:00 +0200
To: bug-autodie [...] rt.cpan.org
From: Peter Valdemar Mørch <peter [...] morch.com>
I've noticed something else, that I consider buggy too, or at least inconsistent. Here are the contents of A.pm: $ cat << END > A.pm package A; sub foo { use autodie; } sub send { } 1; END $ perl -w -c -e 'use autodie; use A;' Prototype mismatch: sub A::send (*$$;$) vs none at A.pm line 7. Subroutine send redefined at A.pm line 6. -e syntax OK Again, a "no autodie;" inside sub foo makes the problem (warning) go away. I'm assuming this is the same issue. If so fine, lets document that here, otherwise, if we agree that this is buggy, let me know that too, and I'll file a separate issue for that. (And I'm not making this up to annoy anybody :-) - we've seen both issues in production code... ) Peter On Fri, Mar 14, 2014 at 4:19 AM, PJF via RT <bug-autodie@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=72053 > > > Due to Niels' amazing efforts, we have a fix for this. I'm hoping to push > a release to CPAN today or tomorrow. > > ~ pjf >
-- Peter Valdemar Mørch http://www.morch.com
On Mon May 19 05:05:18 2014, peter@morch.com wrote: Show quoted text
> I've noticed something else, that I consider buggy too, or at least > inconsistent. Here are the contents of A.pm:
Drat. Can you help us out with your versions of Perl and autodie? ~ pjf
Subject: Re: [rt.cpan.org #72053] "no autodie" doesn't respect lexical scope
Date: Mon, 19 May 2014 13:06:20 +0200
To: bug-autodie [...] rt.cpan.org
From: Peter Valdemar Mørch <peter [...] morch.com>
On Mon, May 19, 2014 at 11:33 AM, PJF via RT <bug-autodie@rt.cpan.org> wrote: Show quoted text
> > Drat. Can you help us out with your versions of Perl and autodie?
Not sure whether "Drat" is for me or another. But: I'm sorry. I've now tested with a newer version of perl (5.14.2), where this is not the problem it was on 5.10.1. So never mind, please disregard. Must have been unrelated. Sorry. old:~> perl -w -c -e 'use autodie; use A;' Prototype mismatch: sub A::send (*$$;$) vs none at A.pm line 7. Subroutine send redefined at A.pm line 6. -e syntax OK old:~> perl --version | grep This This is perl, v5.10.1 (*) built for x86_64-linux-gnu-thread-multi old:~> perl -E'use autodie; say $autodie::VERSION' 2.06_01 old:~> exit exit Connection to old closed. newer:~> perl -w -c -e 'use autodie; use A;' -e syntax OK newer:~> perl --version | grep This This is perl 5, version 14, subversion 2 (v5.14.2) built for x86_64-linux-gnu-thread-multi newer:~> perl -E'use autodie; say $autodie::VERSION' 2.1001 newer:~>
The drat was simply me thinking "Oh noes! A regression!". I'm glad the newer version of perl and autodie help! Have an awesome day! Paul On Mon May 19 07:06:32 2014, peter@morch.com wrote: Show quoted text
> On Mon, May 19, 2014 at 11:33 AM, PJF via RT <bug-autodie@rt.cpan.org> > wrote:
> > > > Drat. Can you help us out with your versions of Perl and autodie?
> > Not sure whether "Drat" is for me or another. But: > > I'm sorry. I've now tested with a newer version of perl (5.14.2), > where this is not the problem it was on 5.10.1. So never mind, please > disregard. Must have been unrelated. Sorry. > > old:~> perl -w -c -e 'use autodie; use A;' > Prototype mismatch: sub A::send (*$$;$) vs none at A.pm line 7. > Subroutine send redefined at A.pm line 6. > -e syntax OK > old:~> perl --version | grep This > This is perl, v5.10.1 (*) built for x86_64-linux-gnu-thread-multi > old:~> perl -E'use autodie; say $autodie::VERSION' > 2.06_01 > > old:~> exit > exit > Connection to old closed. > > newer:~> perl -w -c -e 'use autodie; use A;' > -e syntax OK > newer:~> perl --version | grep This > This is perl 5, version 14, subversion 2 (v5.14.2) built for > x86_64-linux-gnu-thread-multi > newer:~> perl -E'use autodie; say $autodie::VERSION' > 2.1001 > newer:~>