http://www.perlmonks.org?node_id=14685

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question: (dates and times)

I've created a form that has drop downs for the date. like this:

<select name="day" size="1"> <option value="1"> 1</option> <option value="2"> 2</option> <option value="3"> 3</option> .. <option value="31">31</option> </select> <select name="month" size="1"> <option value="1"> 1</option> .. <option value="12">12</option> </select> <select name="year" size="1"> <option value="2000">2000</option> <option value="2001">2001</option> </select>

then in a perlscript I go:

my $post = param('day') . "-" . param('month') . "-" . param('year');
to use in a query against a DB.

Is there a function in perl to make sure someone doesn't choose 31-FEB-2000, or 29-FEB-1999?

Originally posted as a Categorized Question.