paperlined.org
dev > perl > modules > related_modules
document updated 1 year, 2 months ago, on Jan 26, 2023

Alternatives to CGI.pm

CGI.pm clearly states at the top of its documentation that "CGI.pm is no longer considered good practice for developing web applications, including quick prototyping and small web scripts."

A documentation-only module has been released called CGI::Alternatives which lists a few alternatives to using CGI.pm. However, it mainly suggests heavyweight frameworks like Template Toolkit, Mojolicious, Dancer2, Catalyst, etc. That's usually not I would ever use CGI.pm for.

I usually want to just do some basic HTML-escaping or URL-escaping, or once in a while, parsing of the QUERY_STRING, the POST body, or cookies.

Lightweight replacements for CGI.pm

Things that just do URL escaping:

Things that just do HTML escaping:

Things that just parse application/x-www-form-urlencoded and multipart/form-data:

Things that just parse cookies: