in reply to HTML::CalendarMonth date sequence not printing

For certain sequences, your while($year<$year2 || $month1 <= $month2) can form a dead loop.

Inside your loop, the value for $month2 is unchanged, and $month1 goes between 1 and 12. If $month2 equals to 12, $month1 <= $month2 is always true. As true || anything = true, whether $year < $year2 is true or false doesn't make any difference, and the while becomes a dead loop.

Replies are listed 'Best First'.
Re^2: HTML::CalendarMonth date sequence not printing
by Anonymous Monk on Oct 21, 2005 at 08:45 UTC
    Thanks for the explanation - it's really useful. Much appreciated.