use strict; use warnings; @ARGV == 1 or die("Usage: $0 FILE\n"); my $in = shift; open(INFILE, '<', $in) or die("Can't open $in for reading: $!\n"); while () { chomp; for my $char (split //) { my $ord = ord($char); if ( $ord < 9 || ($ord > 10 && $old < 32) || $ord > 126 ) { print("$in contains illegal character \(ord:\ ", "$ord\) on line $.\n"); } } }