use warnings; use strict; while () { chomp; print "This is an invalid entry: $_\n" if /\D/; } __DATA__ 555 3 1234 11-55 fadf 000 -402 1 2 1.2