file_magic read_magic
);
-use AutoLoader;
use FileHandle;
use vars qw($canonical $forgive_me $VERSION);
$VERSION = '2.27';
-*AUTOLOAD = \&AutoLoader::AUTOLOAD; # Grrr...
-#
-# Use of Log::Agent is optional
-#
+BEGIN {
+ if (eval { local $SIG{__DIE__}; require Log::Agent; 1 }) {
+ Log::Agent->import;
+ }
+ #
+ # Use of Log::Agent is optional. If it hasn't imported these subs then
+ # provide a fallback implementation.
+ #
+ else {
+ require Carp;
-{
- local $SIG{__DIE__};
- eval "use Log::Agent";
-}
+ *logcroak = sub {
+ Carp::croak(@_);
+ };
-require Carp;
+ *logcarp = sub {
+ Carp::carp(@_);
+ };
+ }
+}
#
# They might miss :flock in Fcntl
Storable::init_perinterp();
}
-# Can't Autoload cleanly as this clashes 8.3 with &retrieve
-sub retrieve_fd { &fd_retrieve } # Backward compatibility
-
# By default restricted hashes are downgraded on earlier perls.
$Storable::downgrade_restricted = 1;
$Storable::accept_future_minor = 1;
XSLoader::load 'Storable', $Storable::VERSION;
-1;
-__END__
-#
-# Use of Log::Agent is optional. If it hasn't imported these subs then
-# Autoloader will kindly supply our fallback implementation.
-#
-
-sub logcroak {
- Carp::croak(@_);
-}
-
-sub logcarp {
- Carp::carp(@_);
-}
#
# Determine whether locking is possible, but only when needed.
return $self;
}
+sub retrieve_fd { &fd_retrieve } # Backward compatibility
+
#
# thaw
#