Skip Menu |

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

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

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

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



Subject: Unparsable value in DM5 parses fine in DM6
Hello, I am porting some packages to a newer OS which includes newer Date::Manip. A string which is not a date -- "123456.78" -- is not supposed to correctly parse as a date. With DM6, it parses fine (see below) and thus our software cannot catch invalid input anymore. sh$ perl -MDate::Manip -e 'print "V: $Date::Manip::VERSION\n"' V: 6.42 sh$ DATE_MANIP=DM5 perl -MDate::Manip -e '$d = ParseDate("123456.78"); print "d: <$d>\n"' d: <> sh$ DATE_MANIP=DM6 perl -MDate::Manip -e '$d = ParseDate("123456.78"); print "d: <$d>\n"' d: <2014051312:34:56>
Sorry, but the string 123456.78 IS a valid ISO 8601 date: HHMMSS.SSSSS In other words, this is the same as: today at 12:34:56 with some fractional seconds (which Date::Manip parses, but ignores). So, what you're really reporting is a bug in DM5 in that it did not parse a date that ISO 8601 says is valid.
On Tue May 13 10:46:25 2014, SBECK wrote: Show quoted text
> Sorry, but the string > 123456.78 > IS a valid ISO 8601 date: > > HHMMSS.SSSSS
Thanks for clarifying! I'll need to play with the options a bit, then.
On Tue May 13 11:31:31 2014, DMITRI wrote: Show quoted text
> Thanks for clarifying! I'll need to play with the options a bit, then.
I'll make another post here in hopes that it may be useful to someone else. I need the software to work as before on the old system and I don't want to use DM5 compatibility layer. In the code, I did this: if ($Date::Manip::VERSION =~ m/^5/ || exists &Date::Manip::DM5::ParseDate) { old_code(); # Use buggy ParseDate as before } else { my $date = Date::Manip::Date->new; my $err = $date->parse_date($arg); # "123456.78" no longer parses ... } This works in all three cases: Date::Manip 5, Date::Manip 6, and DM5 compatibility layer.