in reply to Removing Junk from Files

Hey if you only want alphanumeric, here you are :
open FILE, "something"; while (<FILE>) { s/[^A-Za-z0-9!?,.;:'"]//g; print $_; }
Add whatever charakter you want to see to the !?,.;:'" part.
What does this do ?
replace every charakter that is not one of the chars in [] with nothing. This might be better than list every not-wanted char in the []. the ^ at the beginning do the '!=' job :-).

Hope this will help.

----------------------------------- --the good, the bad and the physi-- -----------------------------------

Replies are listed 'Best First'.
Re: Re: Removing Junk from Files
by Beatnik (Parson) on Apr 12, 2001 at 13:40 UTC
    s/[\W!?,.;:'"]//g; would do too... I think \W uses locale

    Greetz
    Beatnik
    ... Quidquid perl dictum sit, altum viditur.