See the localtime page for more details.my $yearfield = get_it_from_somewhere(); my $current_year = (localtime)[5] + 1900; die "invalid number\n" unless $yearfield =~ /^\d+$/; die "invalid year\n" if $yearfield > $current_year;
_ _ _ _ (_|| | |(_|>< _|
In reply to Re: How to validate the year of a date?
by gmax
in thread How to validate the year of a date?
by slok
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |