in reply to Re: How to validate the year of a date?
in thread How to validate the year of a date?

The "invalid number" test should probably be a little more picky:
... unless $yearfield =~ /^\d{4}$/;
or maybe the user should be indulged when entering strings like "02", "99", etc, which entails something messier, like:
... unless $yearfield =~ /^(\d{2}){1,2}$/; if (length($yearfield) == 2) { $millen = ( $yearfield =~ /^0/ ) ? "20" : "19"; $yearfield = $millen . $yearfield; } ...
(In this case, naturally, one shouldn't expect this script to still be in use after 2009, nor should users ever want to refer to years in the 19th century -- I have no problem with that.)