How can I write a web application in Perl so that it can work as plain CGI script, as FastCGI / FCGI script, and from mod_perl
/ mod_perl2
(preferably using only core Perl modules and those from libwww-Perl, and minimizing number of Perl CPAN modules one has to install)? I'd like to minimize changes one has to do to change script from using CGI to the one using FastCGI, or mod_perl.
Further constraint: if possible, I'd like to kee web application in single file, and not split it in modules, as it is currently.
The web app in question is gitweb, Git web interface, if it matters.