http://qs321.pair.com?node_id=14688


in reply to How do I validate a date?

There are a couple ways to do this. The best that comes to mind is to grab a module for it (I prefer Date::Calc personally). You could then do something like
unless(check_date(param('year'), param('month'), param('day')) { # do something }
A non-modular way to accomplish this would be to create an array of month lengths, i.e.
my @month_lengths = (31, 28, 31, 30, ......);
which would require one additional check for leap-year.