Right off the bat I see some big problems.
if ($currentyear % 4) {
$next = $leapdays{$currentmonth} - $currentday + 1 + $param{jumpto};
} else {
$next = $nonleapdays{$currentmonth} - $currentday + 1 + $param
+{jumpto};
}
This is wrong, leap years have 2 more rules associated with them.
If the year is divisible by 4, it is a leap year, UNLESS
The year is also divisible by 100, then it's not a leap year, UNLESSThe year is also divisible by 400, then it is a leap year
Anytime I think to myself someone has probably done this (leap years and date manipulation) before, I think, 'I should look on CPAN'. One CPAN module you'll find is Date::Calc you should run and grab this.
It's not a hard module to use and I guarentee you'll have your problem (plus others) fixed if you implement it.
grep
grep> cd /pub grep> more beer |
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.