summaryrefslogtreecommitdiff
path: root/cpan/autodie
diff options
context:
space:
mode:
authorChris 'BinGOs' Williams <chris@bingosnet.co.uk>2012-06-08 13:30:42 +0100
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>2012-06-17 21:26:49 +0100
commit32374c8c83d7777087a5c2e677b17e6d8d7b8143 (patch)
tree31463bba4807adb01c8727a4113935c201e64d70 /cpan/autodie
parent5df103ab73b6ab42851b6d0eef6e18aa79ff938b (diff)
downloadperl-32374c8c83d7777087a5c2e677b17e6d8d7b8143.tar.gz
Updated autodie to CPAN version 2.11
[DELTA] 2.11 * DOCS: Explicitly documented that autodie is context unaware. (Thanks to chromatic.) * TEST: Multi-arg open tests are skipped on VMS. (Thanks to Craig A. Berry.) * TEST BUGFIX recv.t shouldn't assume STDIN is a file handle. (Thanks to Todd Rinaldo) * TEST: Fixed compatibility with Carp 1.25. (Thanks to Olivier Mengué.) * INTERNAL: Exception classes are loaded more safely. (Thanks to Schwern)
Diffstat (limited to 'cpan/autodie')
-rw-r--r--cpan/autodie/lib/Fatal.pm7
-rw-r--r--cpan/autodie/lib/autodie.pm6
-rw-r--r--cpan/autodie/lib/autodie/exception.pm2
-rw-r--r--cpan/autodie/lib/autodie/exception/system.pm2
-rw-r--r--cpan/autodie/lib/autodie/hints.pm2
-rw-r--r--cpan/autodie/t/backcompat.t2
-rw-r--r--cpan/autodie/t/recv.t9
7 files changed, 20 insertions, 10 deletions
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";