Skip Menu |

This queue is for tickets about the autodie CPAN distribution.

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

People
Owner: Nobody in particular
Requestors: trlorenz [...] hotmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.10
Fixed in: 2.21



Subject: Scoping issue.
Hello all. My understanding is that running test.pl here should result in an exception for the failed open: <test.pl> use autodie; use FOO; <FOO.pm> use autodie; open(my $fh, 'NO SUCH FILE'); 1; But it exits quietly. Though it shouldn't be necessary, the above can be convinced to die by adding a package declaration to FOO.pm: <FOO.pm> package ANYTHING_BUT_main; use autodie; open(my $fh, 'NO SUCH FILE'); 1; Perhaps there's some kind of global caching going on that's at odds with autodie's function as a lexical pragma? autodie 2.10 perl 5.12.1 (Strawberry) Windows 7 Thanks for your consideration, and for the great module (and sorry if my assumptions are bad).
On Thu Nov 25 20:55:45 2010, Hassler wrote: Show quoted text
> My understanding is that running test.pl here should result in an > exception for the failed open:
My understanding matches yours. This looks like a bug. Autodie jumps through a bunch of hoops it jumps through to make sure it isn't leaking into other required/used files when it's not supposed to. My guess is that this will be where our bug lies. Thank you very much indeed for the report, and for the test cases. I hope to investigate more soon. Paul
On Thu Nov 25 21:09:25 2010, PJF wrote: Show quoted text
> On Thu Nov 25 20:55:45 2010, Hassler wrote: >
> > My understanding is that running test.pl here should result in an > > exception for the failed open:
> > My understanding matches yours. This looks like a bug. > > Autodie jumps through a bunch of hoops it jumps through to make sure it > isn't leaking into other required/used files when it's not supposed to. > My guess is that this will be where our bug lies. > > Thank you very much indeed for the report, and for the test cases. I > hope to investigate more soon. > > Paul
This was apparently fixed in v2.21 by commit 68e2803[1] (according to git bisect). But honestly, I do not really understand how that commit fixed it. ~Niels [1] https://github.com/pjf/autodie/commit/68e2803e68f7122069f78be2dc54bec053462c45