X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=ext%2FStorable%2FStorable.pm;h=8ec8e1e58b4d23ba409f4c3ec0bdf4f969833bcd;hb=821bf9a5d89e1fc44be0165540e1f57de5c874e1;hp=81c94c8507d3bd2d896edf9ab6c0b42e4ba38485;hpb=643157af7ab6b9560550325fafc5ed259fe9b954;p=p5sagit%2Fp5-mst-13.2.git diff --git a/ext/Storable/Storable.pm b/ext/Storable/Storable.pm index 81c94c8..8ec8e1e 100644 --- a/ext/Storable/Storable.pm +++ b/ext/Storable/Storable.pm @@ -21,7 +21,7 @@ package Storable; @ISA = qw(Exporter DynaLoader); use AutoLoader; use vars qw($canonical $forgive_me $VERSION); -$VERSION = '2.08'; +$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 @@ -786,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);