Posted on 2009-01-27 10:40:54-08 by destiny
Perl Bug on Time::Format

Hello there.

I think I found a bug on this module. For example this small script:

#!/usr/bin/perl -w

use strict;

use warnings;

use Time::HiRes qw(sleep gettimeofday);

use Time::Format qw/%time/;

for(;;){

my $time = join '.', gettimeofday;

print $time{'Mon d hh:mm:ss.mmm', $time};

print "\n";

}

Produce the following error:

root@root:~/Desktop$ ./perl_bug.pl

Jan 27 11:20:27.498

Jan 27 11:20:27.509

Jan 27 11:20:27.510

Jan 27 11:20:27.510

Jan 27 11:20:27.510

Jan 27 11:20:27.510

Jan 27 11:20:27.510

Jan 27 11:20:27.510

.....

Jan 27 11:20:28.980

Jan 27 11:20:28.418

Jan 27 11:20:28.619

Jan 27 11:20:28.799

Day '52' out of range 1..31 at (eval 2) line 277

root@root:~/Desktop$

Regards,

Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.