On Thu Jun 20 09:31:42 2013, Michael.Jacob3@de.ibm.com wrote: > This is a bug report for perl from DE113631@BROADBRICK, > generated with the help of perlbug 1.39 running under perl 5.10.1. > > > ----------------------------------------------------------------- > [Please describe your issue here] > > > If the serialized form returned by STORABLE_freeze() is the empty > string > STORABLE_thaw()/_attach() will be fed undef instead. > > (This may be intended but not documented.) > > package xyz; > > use Storable qw(freeze thaw); > > sub new { > my $class = shift; > my $string = shift; > die 'Bad data' unless defined $string; > my $self = { string => $string }; > return bless $self, $class; > } > > sub STORABLE_freeze { > my $self = shift; > my $cloning = shift; > return if $cloning; > return ($self->{string}); > } > > sub STORABLE_attach { > my $class = shift; > my $cloning = shift; > my $string = shift; > return $class->new($string); > } > > print $Storable::VERSION, "\n"; # 2.39 > > $a = [ xyz->new('a'), xyz->new('') ]; > > $b = freeze($a); > > thaw($b); # <-- dies here with "Bad data" > I can confirm that this also occurs with blead and Storable 2.43. --- via perlbug: queue: perl5 status: new https://rt.perl.org:443/rt3/Ticket/Display.html?id=118551Thread Previous | Thread Next