Skip Menu |

This queue is for tickets about the Data-FormValidator CPAN distribution.

Maintainer(s)' notes

This is the bug queue for Data::FormValidator.

Report information
The Basics
Id: 6417
Status: resolved
Priority: 0/
Queue: Data-FormValidator

People
Owner: MARKSTOS [...] cpan.org
Requestors: mdorman [...] debian.org
Cc:
AdminCc:

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



Subject: Removing uninitialized value warnings in Date constraints
Although 3.58 cleared up many related warnings, there were two still left that I was running into: Use of uninitialized value in string eq at /usr/share/perl5/Data/FormValidator/Constraints/Dates.pm line 94 Use of uninitialized value in string eq at /usr/share/perl5/Data/FormValidator/Constraints/Dates.pm line 95 I took a very simplistic (and, I believe, obviously correct) approach and came up with the following patch: --- Dates.pm~ 2004-05-05 19:11:04.000000000 -0500 +++ Dates.pm 2004-05-25 15:41:32.000000000 -0500 @@ -91,8 +91,10 @@ $result{$format->[1]->[$i]} ||= $data[$i]; } - $result{h} += 12 if ($result{p} eq 'PM' and $result{h} != 12); - $result{h} = 0 if ($result{p} eq 'AM' and $result{h} == 12); + if (exists $result{p}) { + $result{h} += 12 if ($result{p} eq 'PM' and $result{h} != 12); + $result{h} = 0 if ($result{p} eq 'AM' and $result{h} == 12); + } return $untainted_date, map {defined $result{$_} ? $result{$_} : 0} qw(Y M D h m s);
[guest - Tue May 25 17:02:15 2004]: Show quoted text
> Although 3.58 cleared up many related warnings, there were two still > left that I was running into: > > Use of uninitialized value in string eq at > /usr/share/perl5/Data/FormValidator/Constraints/Dates.pm line 94 > Use of uninitialized value in string eq at > /usr/share/perl5/Data/FormValidator/Constraints/Dates.pm line 95 > > I took a very simplistic (and, I believe, obviously correct) approach > and came up with the following patch: > > --- Dates.pm~ 2004-05-05 19:11:04.000000000 -0500 > +++ Dates.pm 2004-05-25 15:41:32.000000000 -0500 > @@ -91,8 +91,10 @@ > $result{$format->[1]->[$i]} ||= $data[$i]; > } > > - $result{h} += 12 if ($result{p} eq 'PM' and $result{h} != 12); > - $result{h} = 0 if ($result{p} eq 'AM' and $result{h} == 12); > + if (exists $result{p}) { > + $result{h} += 12 if ($result{p} eq 'PM' and $result{h} != > 12); > + $result{h} = 0 if ($result{p} eq 'AM' and $result{h} == > 12); > + } > > > return $untainted_date, map {defined $result{$_} ? $result{$_} : > 0} qw(Y M D h m s);
Michael, This patch has been accepted and will appear in the next release with credit to you. I'm marking this ticket as stalled until the next release.
Now released in 3.59, uploaded to CPAN, and available here for now: http://mark.stosberg.com/dfv/Data-FormValidator-3.59.tar.gz Mark