I wrote a script to mirror a directory tree in Unix onto NT boxes.
The mirroring is done via FTP by pushing from the Unix box to each
NT box. Everything was working until one day, my script came accros a
file on the NT box that had a modification time of some minutes after
12 noon. The directory entry was such:
03-11-97 12:36PM 88224 2090z2.plo
^^ ^^-- this combination of 12 and PM caused a problem
A lot of debugging steps later, it seems that the problem is in
module Date.pm, around lines 266-271:
266 if ($aorp) {
267 $aorp = uc $aorp;
*->268 $hr = 0 if $hr == 12 && $aorp eq 'AM';
269 $hr += 12 if $aorp eq 'PM';
271 }
When this part of the code was reached, $hr is 12
and $aorp (AM or PM) is 'PM'. If you follow the code,
you'll see that $hr gets incremented by 12 at line 269. This
results in "$hr" being "24" which eventually causes
/usr/local/lib/perl5/Time/Local.pm to croak with:
Hour out of range 0..23 in timelocal.pl at \
/usr/local/lib/perl5/site_perl/HTTP/Date.pm line 286
The croak happens at line 77 of /usr/local/lib/perl5/Time/Local.pm .
Sub cheat lin Local.pm complains that the hour is out of range (line 77).
Cheat expects the hour to be between 0 and 23 (sounds reasonable).
So I think Date.pm needs to have line 268 changed from:
268 $hr = 0 if $hr == 12 && $aorp eq 'AM';
to:
268 $hr = 0 if $hr == 12;
My Date.pm had the following Id:
$Id: Date.pm,v 1.22 1996/11/25 08:18:32 aas Exp $
which came from libwww-perl-5.05.tar . I have since then down-
loaded libwww-perl-5.07 with Id:
$Id: Date.pm,v 1.23 1997/01/30 15:41:01 aas Exp $
but it looks like it still has the same problem. I didn't
actually install and try this new version, but looking at the
code, it looks like this problem is still there (though the line
in question is now at line #278 of Date.pm).
I hope someone will fix this permanently. Thanks. And especially
thanks to Gisle Aas, Martijn Koster, and all others who may have
contributed to the making of libwww .
Marnix A. van Ammers
mav6@pge.com
510-779-7378