INPUT: while (<>) { chomp; /[^\d\t-]/ and next; my @nums = split /\t/; @nums == 7 or next; ( /^-?\d+/and $_ >= -2**31 and $_ < 2**31 ) or next INPUT for @nums; print "good line: $_"; }