diff options
-rwxr-xr-x | Porting/Maintainers.pl | 2 | ||||
-rw-r--r-- | cpan/autodie/lib/Fatal.pm | 7 | ||||
-rw-r--r-- | cpan/autodie/lib/autodie.pm | 6 | ||||
-rw-r--r-- | cpan/autodie/lib/autodie/exception.pm | 2 | ||||
-rw-r--r-- | cpan/autodie/lib/autodie/exception/system.pm | 2 | ||||
-rw-r--r-- | cpan/autodie/lib/autodie/hints.pm | 2 | ||||
-rw-r--r-- | cpan/autodie/t/backcompat.t | 2 | ||||
-rw-r--r-- | cpan/autodie/t/recv.t | 9 |
8 files changed, 21 insertions, 11 deletions
diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl index 5d28d7f2de..684b70428e 100755 --- a/Porting/Maintainers.pl +++ b/Porting/Maintainers.pl @@ -229,7 +229,7 @@ use File::Glob qw(:case); 'autodie' => { 'MAINTAINER' => 'pjf', - 'DISTRIBUTION' => 'PJF/autodie-2.10.tar.gz', + 'DISTRIBUTION' => 'PJF/autodie-2.11.tar.gz', 'FILES' => q[cpan/autodie], 'EXCLUDED' => [ qr{^inc/Module/}, diff --git a/cpan/autodie/lib/Fatal.pm b/cpan/autodie/lib/Fatal.pm index aabdf781de..3526fe0364 100644 --- a/cpan/autodie/lib/Fatal.pm +++ b/cpan/autodie/lib/Fatal.pm @@ -40,7 +40,7 @@ use constant ERROR_58_HINTS => q{Non-subroutine %s hints for %s are not supporte use constant MIN_IPC_SYS_SIMPLE_VER => 0.12; # All the Fatal/autodie modules share the same version number. -our $VERSION = '2.10'; +our $VERSION = '2.11'; our $Debug ||= 0; @@ -116,6 +116,7 @@ my %TAGS = ( ':2.08' => [qw(:default)], ':2.09' => [qw(:default)], ':2.10' => [qw(:default)], + ':2.11' => [qw(:default)], ); # chmod was only introduced in 2.07 @@ -1238,7 +1239,9 @@ sub exception_class { return "autodie::exception" }; { local $@; # We can't clobber $@, it's wrong! - eval "require $exception_class"; ## no critic + my $pm_file = $exception_class . ".pm"; + $pm_file =~ s{ (?: :: | ' ) }{/}gx; + eval { require $pm_file }; $E = $@; # Save $E despite ending our local. } diff --git a/cpan/autodie/lib/autodie.pm b/cpan/autodie/lib/autodie.pm index cb14fb037b..95a940c178 100644 --- a/cpan/autodie/lib/autodie.pm +++ b/cpan/autodie/lib/autodie.pm @@ -8,7 +8,7 @@ our @ISA = qw(Fatal); our $VERSION; BEGIN { - $VERSION = '2.10'; + $VERSION = '2.11'; } use constant ERROR_WRONG_FATAL => q{ @@ -334,6 +334,10 @@ the end of the current block with C<no autodie>. To disable autodie for only a single function (eg, open) use C<no autodie qw(open)>. +C<autodie> performs no checking of called context to determine whether to throw +an exception; the explicitness of error handling with C<autodie> is a deliberate +feature. + =item No user hints defined for %s You've insisted on hints for user-subroutines, either by pre-pending diff --git a/cpan/autodie/lib/autodie/exception.pm b/cpan/autodie/lib/autodie/exception.pm index 14d5cb0f07..474d9293b2 100644 --- a/cpan/autodie/lib/autodie/exception.pm +++ b/cpan/autodie/lib/autodie/exception.pm @@ -14,7 +14,7 @@ use overload use if ($] >= 5.010), overload => '~~' => "matches"; -our $VERSION = '2.10'; +our $VERSION = '2.11'; my $PACKAGE = __PACKAGE__; # Useful to have a scalar for hash keys. diff --git a/cpan/autodie/lib/autodie/exception/system.pm b/cpan/autodie/lib/autodie/exception/system.pm index 747fea7810..a3557d3282 100644 --- a/cpan/autodie/lib/autodie/exception/system.pm +++ b/cpan/autodie/lib/autodie/exception/system.pm @@ -5,7 +5,7 @@ use warnings; use base 'autodie::exception'; use Carp qw(croak); -our $VERSION = '2.10'; +our $VERSION = '2.11'; my $PACKAGE = __PACKAGE__; diff --git a/cpan/autodie/lib/autodie/hints.pm b/cpan/autodie/lib/autodie/hints.pm index 89b3bc827b..3758eca03e 100644 --- a/cpan/autodie/lib/autodie/hints.pm +++ b/cpan/autodie/lib/autodie/hints.pm @@ -5,7 +5,7 @@ use warnings; use constant PERL58 => ( $] < 5.009 ); -our $VERSION = '2.10'; +our $VERSION = '2.11'; =head1 NAME diff --git a/cpan/autodie/t/backcompat.t b/cpan/autodie/t/backcompat.t index 174d6da9b0..b26c421d79 100644 --- a/cpan/autodie/t/backcompat.t +++ b/cpan/autodie/t/backcompat.t @@ -8,7 +8,7 @@ eval { open(my $fh, '<', NO_SUCH_FILE); }; -my $old_msg = qr{Can't open\(GLOB\(0x[0-9a-f]+\), <, xyzzy_this_file_is_not_here\): .* at \(eval \d+\)(?:\[.*?\])? line \d+\.\s+main::__ANON__\('GLOB\(0x[0-9a-f]+\)',\s*'<',\s*'xyzzy_this_file_is_not_here'\) called at \S+ line \d+\s+eval \Q{...}\E called at \S+ line \d+}; +my $old_msg = qr{Can't open\(GLOB\(0x[0-9a-f]+\), <, xyzzy_this_file_is_not_here\): .* at \(eval \d+\)(?:\[.*?\])? line \d+\.?\s+main::__ANON__\('GLOB\(0x[0-9a-f]+\)',\s*'<',\s*'xyzzy_this_file_is_not_here'\) called at \S+ line \d+\s+eval \Q{...}\E called at \S+ line \d+}; like($@,$old_msg,"Backwards compat ugly messages"); is(ref($@),"", "Exception is a string, not an object"); diff --git a/cpan/autodie/t/recv.t b/cpan/autodie/t/recv.t index cfaa679144..f67b2f8187 100644 --- a/cpan/autodie/t/recv.t +++ b/cpan/autodie/t/recv.t @@ -38,12 +38,15 @@ SKIP: { } eval { - # STDIN isn't a socket, so this should fail. - recv(STDIN,$buffer,1,0); + my $string = "now is the time..."; + open(my $fh, '<', \$string) or die("Can't open \$string for read"); + # $fh isn't a socket, so this should fail. + recv($fh,$buffer,1,0); }; ok($@,'recv dies on returning undef'); -isa_ok($@,'autodie::exception'); +isa_ok($@,'autodie::exception') + or diag("$@"); $buffer = "# Not an empty string\n"; |