in reply to What if mod_perl is not an option?
I would suggest though writing your CGI apps in such a way that if you do need to move over to mod_perl, or get the chance to, you can do it easily. Essentially avoid all global variables and put as much as you can into modules. If you use CGI::Application then this is done for you to a large extent. If you don't want to use CGI::Application you can still borrow the idea of having CGI scripts that look like this:
As an added advantage you give away very little to bad guys if the see the source to your CGI script as all the sensitive bits are in the module.#!/usr/local/bin/perl use lib '/path/to/my/files/perl/'; use MyWebApp; MyWebApp->go();
As for database connections you will not be able to store them between requests but this is not likely to be a performance concern compared to other bottlenecks that exist (ie firing up perl each time) - worry about it if it becomes a problem.
Update: Changed 'rarely needed' to 'rarely vital' in first line to be more accurate.
--tidiness is the memory loss of environmental mnemonics
|
|---|