in reply to How do I validate a date?

You could use the ParseDate subroutine from Date::Manip (or some other date manipulation package) to parse the date. If it parses correctly, it must be valid.

But Date::Manip could be overkill if all you want to do is validate the date. You could just check the day of the month against an array indexed by month in which you store how many days each month has. You would have to pre-check for leap years and modify the number of days in february accordingly.

Leap-year code posted by Adam -- Q&AEditors

# $year is a leap year if ($year % 4 == 0) and ($year % 100 != 0 or $year % 400 == 0)
--ZZamboni