in reply to Travesty -- done properly
$text =~ s/[^A-z\.\,\;\-\n\'\ \?\"0-9\$\:]//g; $text =~ s/\n/ /g; while ($text =~ s/\s\s/ /g) {};
I would likely do those as:
$text =~ tr/A-z0-9.,;'?!":$\n\t\r -//dc; $text =~ s/\s+/ /g;
I also added in "!" and "\t\r" since it seems unfair to rip tabs and Mac/PC returns out. The while thing is really evil and smells of removed code. =)
Update: fixed where I had $test rather than $text. Lysdexics of the world, Untie!
--
$you = new YOU;
honk() if $you->love(perl)
|
|---|