if($str !~ /[^[:ascii:]]/) { print "Non ASCII character found in $."; }