Hi, I am trying to remove from file : 1. all characters but any alphabet and numbers (i.e., file shd not contain anything but "alphabets and numbers" that means NO punctuation etc... 2. all trailing spaces should be made to one space. following code doesnt seem to work for objective [1] mentioned above. Can anyone please point whats wrong with the second line and what changes should I make ?
Thanks, Mandar --- open(fp,$file) or die "Cant open $file :$!\n"; @cont=<fp>; for(@cont) { tr/A-Z/a-z/; # converts all uppercase to lowercase s/^[a-z0-9]+/ /; # substitute all non alphabets and numbers by space s/\s+/ /g; # removes trailing spaces } --- ------------------- Mandar Rahurkar ECE, UIUC ------------------- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>