in reply to A Perl/CGI alternative to PHP's htmlentities()?

... and if, by chance, you're seeking to clean up user input from the web, please, don't stop with character entities. Read up on untainting for a start, if for no other purpose than to get some flavor of the scope of security issues with un-moderated user input.

Cleaning up html entities -- even as benign as   or &sect (though, in some instances, those could be abused) -- is often a good thing... but depending on the source of the "data" you're seeking "to sanitize," it may be only an inadequate protection.