in reply to CGI - hazardous characters
I'm not sure from your question what you're after. Maybe HTML::Strip or HTML::Scrubber? I use the latter to remove some HTML tags and not others, while also removing any JavaScript.
In Section
Seekers of Perl Wisdom