Skip Menu |

This queue is for tickets about the Date-Manip CPAN distribution.

Report information
The Basics
Id: 67143
Status: resolved
Priority: 0/
Queue: Date-Manip

People
Owner: Nobody in particular
Requestors: FBRIERE [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 6.22
Fixed in: (no value)



Subject: Parsing date "now" fails when using a cloned Base
In the following example, the first date is parsed and output appropriately, but the second date, built on a cloned Base, produces this error: WARNING: [printf] Object must contain a valid date Use of uninitialized value in print at ... my $base = new Date::Manip::Base; my $date = new Date::Manip::Date $base; $date->parse('now'); print $date->printf('%g'); my $base2 = new Date::Manip::Base $base; my $date2 = new Date::Manip::Date $base2; $date2->parse('now'); print $date2->printf('%g');
That was a bug. Sorry about that. I've fixed it and it'll be in the next release. If you need a fix before then, just modify you Date::Manip::Obj.pm file near line 118 to be: if ($class eq 'Date::Manip::Base') { if ($base) { # new Date::Manip::Base $base if (@opts) { $new = $base; } else { # dclone doesn't handle regexps my $tmp = $$base{'data'}{'rx'}; delete $$base{'data'}{'rx'}; $new = dclone($base); $$base{'data'}{'rx'} = $tmp; $$new{'data'}{'rx'} = $tmp; } $init = 0; } Sorry for the inconvenience.