This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Restore Storable support for 5.005 and (astoundingly) 5.004
authorNicholas Clark <nick@ccl4.org>
Tue, 28 May 2013 19:37:06 +0000 (21:37 +0200)
committerAbhijit Menon-Sen <ams@toroid.org>
Sat, 13 Jul 2013 16:44:58 +0000 (22:14 +0530)
It even passes all tests on 5.004.

dist/Storable/Storable.pm

index 5f63871..8f5f7b0 100644 (file)
@@ -31,13 +31,13 @@ BEGIN {
     # Use of Log::Agent is optional. If it hasn't imported these subs then
     # provide a fallback implementation.
     #
-    if (!exists &logcroak) {
+    unless ($Storable::{logcroak} && *{$Storable::{logcroak}}{CODE}) {
         require Carp;
         *logcroak = sub {
             Carp::croak(@_);
         };
     }
-    if (!exists &logcarp) {
+    unless ($Storable::{logcarp} && *{$Storable::{logcarp}}{CODE}) {
        require Carp;
         *logcarp = sub {
           Carp::carp(@_);