$/ = undef; open FH, "< $wordstarfile" or die "craps. $!"; $doc = ; # delete all ctrl chars except newline $doc =~ tr/\x00-\x09\x0b-\x1f//d; # turn off all high bits $doc =~ s/([\xa0-\xff])/chr(ord($1) ^ 0x80)/eg; print $doc;