Skip Menu |

This queue is for tickets about the Params-Validate CPAN distribution.

Report information
The Basics
Id: 51155
Status: resolved
Priority: 0/
Queue: Params-Validate

People
Owner: Nobody in particular
Requestors: pe [...] nilu.no
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.93



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
Subject: Params::Validate pure perl version alters hashref passed to validate()
On Thu Nov 05 19:11:14 2009, pe@nilu.no wrote: Show quoted text
> 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 > >
This is actually a bug in the pure Perl version of Params::Validate. I guess one system has the XS version installed, and one doesn't. You might want to fix that regardless, but I'll release a new PV to fix this bug.