I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2006-09-18 21:50:06-07 by methylal in response to 2881
Re: Day '31' out of range 1..30
Looking at the module:

You will see that Months are set in an array:
my @MonthDays = (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);

Therefore, when it tries to pull the number of days for the month you passed to it, it's searching it's index from 0 to 11. So when you pass in your Month as 10 (October), it's searching the array and thinking only 30 days are avilable and failing when you specify 31 since you are technically 'out of range'.

Three solutions:
1) Subtract 1 from your month before passing it into the Time::timelocal method
2) Just open up your Local.pm file and in the subroutine (timegm), look for the following:
my $md = $MonthDays[$month];
and subtract 1 from $month... so:
my $md = $MonthDays[$month-1];
3) Use DateTime::Precise instead.

--meth
Direct Responses: Write a response