http://www.perlmonks.org?node_id=850343


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.