in reply to Re: Regular expression for date
in thread Regular expression for date

Apologizes : The previous script hanged on bad date, this one runs better (thanks to "eval") !
use Time::Local timelocal; my ($m,$d,$y,$t); do { my ($date); print "date (MM-DD-YY) ? "; $date=<>; chomp($date); ($m,$d,$y)=split(/-/,$date); $m -= 1; $y += 1900; $t = eval "timelocal(0,0,0,$d,$m,$y)"; } until (!$t);