Subject: | bug using DateTime::Duration |
Date: | Fri, 06 Nov 2009 01:10:24 +0100 |
To: | bug-DateTime [...] rt.cpan.org |
From: | Paul Eckhardt <pe [...] nilu.no> |
Hi,
I found a bug in DateTime 0.51, while running a script that worked on 0.49
I hope the description is sufficient. If not, please feel free to contact me.
Kind regards
Paul
testscript:
use DateTime;
my $d = {seconds=>22};
my $dur = new DateTime::Duration($d);
print keys(%$d);
on my development system this works as expected (output is "seconds")
on one production system the output would be:
"hoursminutesdayssecondsyearsend_of_monthnanosecondsmonthsweeks"
(all extra keys seem to be set to undef). but the existence of the keys leads to an exception at a consecutive call of DateTime::Duration::new with the same hashref.
example:
use DateTime;
my $d = {seconds=>22};
my $dur = new DateTime::Duration($d);
$dur = new DateTime::Duration($d);
crashes at the second creation of the duration object:
The 'end_of_month' parameter (undef) to DateTime::Duration::new was an 'undef', which is not one of the allowed types: scalar
at C:/Perl/site/lib/Params/ValidatePP.pm line 634
production system (bug):
Windows xp
perl v5.10.1 built for MSWin32-x86-multi-thread (ActiveState build 1006)
DateTime v0.51
development system (no bug):
ubuntu 9.10
perl v5.10.0 built for i486-linux-gnu-thread-multi
DateTime v0.49