Subject: | autodie does not honor file scope... |
Date: | Fri, 27 May 2016 07:17:33 +0200 |
To: | bug-autodie [...] rt.cpan.org |
From: | Peter Valdemar Mørch <peter [...] morch.com> |
perldoc autodie says:
The "autodie" pragma has lexical scope, meaning that functions and
Show quoted text
> subroutines altered with "autodie" will only change their behaviour
> until
> the end of the enclosing block, file, or "eval".
>
Therefore I expect A::bad to die below. It doesn't.
#!/usr/bin/perl -w
use strict;
use autodie;
package A;
sub bad {
open(my $i, '<', 'nonexist');
}
package main;
A::bad;
I've created two test cases: file-scope.t (currently fails) and
package-scope.t (currently passes) to cover it.
Peter
Message body is not shown because sender requested not to inline it.
Message body is not shown because sender requested not to inline it.