in reply to remove bad characters

Are you sure that you're not seeing "bad characters" because you're interpreting the file with the incorrect encoding? For instance, the text file may be encoded in UTF-8, but you're reading it as ISO-8859-1.

You may want to give Encode::Guess a try, to figure out what encoding it is.

Clint

Replies are listed 'Best First'.
Re^2: remove bad characters
by lazybowel (Acolyte) on Jun 27, 2007 at 19:15 UTC
    thanks for the help guys, this did the trick
    $string =~ s{ ( [^\x00-\x7E] ) }{}xmsg;
    i just have to start practicing using regex, i'm really bad at it
      That's going to leave many control characters in your data. You haven't specified what a "bad character" is, so that might be OK.