Looks like your code should read:
chomp($value = <STDIN>); if($value =~ /(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.] \d\d +\d\d)/) { print "date"; }else{ print $value; print "not a date"; }
I notice there's a literal space between [- /.] and \d\d\d\d, which may not be what you intended. That's if I've correctly deciphered your very poorly formatted post.
In reply to Re: Problem in date checking script
by kyle
in thread Problem in date checking script
by garyprmr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |