Subject: | Problems with Storable hooks |
Date: | Mon, 29 Jan 2007 14:29:38 -0500 |
To: | bug-DateTime-Locale [...] rt.cpan.org |
From: | rabbit [...] rabbit.us (Peter Rabbitson) |
This might be related to bug #24337, but it is definately not caused by
trying to thaw a 0.2x object (there simply aren't any). Here is my test
script:
=======================
use warnings;
use strict;
use Storable qw/nfreeze thaw dclone/;
use DateTime;
use Data::Dumper;
$Data::Dumper::Sortkeys = 1;
my %vers;
{
no strict 'refs';
foreach my $mod (keys %INC) {
$mod =~ s/\..*//g;
$mod =~ s/\//::/g;
if (my $ver = ${$mod . '::VERSION'}) {
$vers{$mod} = $ver;
}
}
}
print Dumper \%vers;
my @times = (DateTime->now);
for (1..5) {
my $tm = $times[-1];
print $tm;
print "\n";
eval {
push @times, dclone ($tm);
};
if ($@) {
print "dclone() failed: $@\n";
last;
}
}
sleep 1;
my @times2 = (DateTime->now);
for (1..5) {
my $tm = $times2[-1];
print $tm;
print "\n";
eval {
push @times2, thaw (nfreeze ($tm) );
};
if ($@) {
print "thaw()/nfreeze() failed: $@\n";
last;
}
}
==========================
and my output:
==========================
$VAR1 = {
'AutoLoader' => '5.60',
'Carp' => '1.04',
'Data::Dumper' => '2.121_08',
'DateTime' => '0.36',
'DateTime::Infinite' => '-1, set by base.pm',
'DateTime::Locale' => '0.33',
'DateTime::TimeZone' => '0.59',
'DateTime::TimeZone::Floating' => '0.01',
'DateTime::TimeZone::OffsetOnly' => '0.02',
'DateTime::TimeZone::UTC' => '0.01',
'DynaLoader' => '1.04',
'Exporter' => '5.58',
'Exporter::Heavy' => '5.58',
'Fcntl' => '1.05',
'File::Spec' => '3.24',
'File::Spec::Unix' => '1.5',
'List::Util' => '1.19',
'Params::Validate' => '0.87',
'Scalar::Util' => '1.19',
'Storable' => '2.15',
'Time::Local' => '1.17',
'XSLoader' => '0.06',
'base' => '2.07',
'bytes' => '1.02',
'constant' => '1.05',
'integer' => '1.00',
'overload' => '1.04',
'strict' => '1.03',
'utf8' => '1.06',
'vars' => '1.01',
'warnings' => '1.05',
'warnings::register' => '1.01'
};
2007-01-29T19:20:20
2007-01-29T19:20:20
2007-01-29T19:20:20
2007-01-29T19:20:20
2007-01-29T19:20:20
2007-01-29T19:20:21
2007-01-29T19:20:21
thaw()/nfreeze() failed: Parameter #1 (undef) to DateTime::Locale::load
was an 'undef', which is not one of the allowed types: scalar
at /usr/local/share/perl/5.8.8/DateTime/Locale.pm line 199
DateTime::Locale::load('undef', 'undef') called at
/usr/local/share/perl/5.8.8/DateTime/Locale/Base.pm line 135
DateTime::Locale::Base::STORABLE_attach('DateTime::Locale::en',
0, 'undef') called at ../../lib/Storable.pm (autosplit into
../../lib/auto/Storable/thaw.al) line 366
eval {...} called at ../../lib/Storable.pm (autosplit into
../../lib/auto/Storable/thaw.al) line 366
Storable::thaw('\x{5}\x{7}\x{13}B\x{13}\x{2}\x{14}DateTime::Locale::en\x{0}B\x{13}\x{2}\x{17}DateTime::TimeZone::UTC\x{3}UTCB\x{5}...')
called at aa line 50
eval {...} called at aa line 49, at aa line 50
======================
and an output with slightly different module versions (different
server):
=======================
$VAR1 = {
'AutoLoader' => '5.60',
'Carp' => '1.04',
'Data::Dumper' => '2.121_08',
'DateTime' => '0.35',
'DateTime::Infinite' => '-1, set by base.pm',
'DateTime::Locale' => '0.3101',
'DateTime::TimeZone' => '0.42',
'DateTime::TimeZone::Floating' => '0.01',
'DateTime::TimeZone::OffsetOnly' => '0.02',
'DateTime::TimeZone::UTC' => '0.01',
'DynaLoader' => '1.04',
'Exporter' => '5.58',
'Exporter::Heavy' => '5.58',
'Fcntl' => '1.05',
'File::Spec' => '3.24',
'File::Spec::Unix' => '1.5',
'List::Util' => '1.19',
'Params::Validate' => '0.87',
'Scalar::Util' => '1.19',
'Storable' => '2.15',
'Time::Local' => '1.17',
'XSLoader' => '0.06',
'base' => '2.07',
'bytes' => '1.02',
'constant' => '1.05',
'integer' => '1.00',
'overload' => '1.04',
'strict' => '1.03',
'utf8' => '1.06',
'vars' => '1.01',
'warnings' => '1.05',
'warnings::register' => '1.01'
};
2007-01-29T19:27:49
2007-01-29T19:27:49
Use of uninitialized value in subroutine entry at aa line 32.
dclone() failed: Invalid locale name or id:
2007-01-29T19:27:50
2007-01-29T19:27:50
thaw()/nfreeze() failed: Invalid locale name or id: , at aa line 50
=====================================