Modified to stop Log::Agent from loading, that is.
There’s at least one CPAN module that does it. While that module
could be blamed, Storable used to be more robust in this area
before the AutoLoader extirpation, and there is nothing wrong with
robustness.
dist/Storable/t/recurse.t See if Storable works
dist/Storable/t/restrict.t See if Storable works
dist/Storable/t/retrieve.t See if Storable works
+dist/Storable/t/robust.t See if it survives mangled %INC
dist/Storable/t/sig_die.t See if Storable works
dist/Storable/t/st-dump.pl See if Storable works
dist/Storable/t/store.t See if Storable works
use vars qw($canonical $forgive_me $VERSION);
-$VERSION = '2.32';
+$VERSION = '2.33';
BEGIN {
if (eval { local $SIG{__DIE__}; require Log::Agent; 1 }) {
# Use of Log::Agent is optional. If it hasn't imported these subs then
# provide a fallback implementation.
#
- else {
+ if (!exists &logcroak) {
require Carp;
-
*logcroak = sub {
Carp::croak(@_);
};
-
+ }
+ if (!exists &logcarp) {
+ require Carp;
*logcarp = sub {
Carp::carp(@_);
};
--- /dev/null
+#!/usr/bin/perl
+
+# This test script checks that Storable will load properly if someone
+# is incorrectly messing with %INC to hide Log::Agent. No, no-one should
+# really be doing this, but, then, it *used* to work!
+
+use Test::More;
+plan tests => 1;
+
+$INC{'Log/Agent.pm'} = '#ignore#';
+require Storable;
+pass;