while (<>) { chomp; if (m/your regex here/) { # work with it } else { print "Input '$_' not recognized as a date\n"; } }