Upgrade to Cwd 2.16
[p5sagit/p5-mst-13.2.git] / ext / Storable / Storable.pm
index 1283b79..8ec8e1e 100644 (file)
@@ -21,7 +21,7 @@ package Storable; @ISA = qw(Exporter DynaLoader);
 use AutoLoader;
 use vars qw($canonical $forgive_me $VERSION);
 
-$VERSION = '2.05';
+$VERSION = '2.10';
 *AUTOLOAD = \&AutoLoader::AUTOLOAD;            # Grrr...
 
 #
@@ -47,6 +47,11 @@ BEGIN {
        }
 }
 
+sub CLONE {
+    # clone context under threads
+    Storable::init_perinterp();
+}
+
 # Can't Autoload cleanly as this clashes 8.3 with &retrieve
 sub retrieve_fd { &fd_retrieve }               # Backward compatibility
 
@@ -361,6 +366,9 @@ sub thaw {
        return $self;
 }
 
+1;
+__END__
+
 =head1 NAME
 
 Storable - persistence for Perl data structures
@@ -783,10 +791,10 @@ Here are some code samples showing a possible usage of Storable:
 
        %color = ('Blue' => 0.1, 'Red' => 0.8, 'Black' => 0, 'White' => 1);
 
-       store(\%color, '/tmp/colors') or die "Can't store %a in /tmp/colors!\n";
+       store(\%color, 'mycolors') or die "Can't store %a in mycolors!\n";
 
-       $colref = retrieve('/tmp/colors');
-       die "Unable to retrieve from /tmp/colors!\n" unless defined $colref;
+       $colref = retrieve('mycolors');
+       die "Unable to retrieve from mycolors!\n" unless defined $colref;
        printf "Blue is still %lf\n", $colref->{'Blue'};
 
        $colref2 = dclone(\%color);
@@ -810,7 +818,7 @@ compartment:
        use strict;
        my $safe = new Safe;
         # because of opcodes used in "use strict":
-       $safe->permit(qw(:default require caller));
+       $safe->permit(qw(:default require));
        local $Storable::Deparse = 1;
        local $Storable::Eval = sub { $safe->reval($_[0]) };
        my $serialized = freeze(sub { 42 });