in reply to What if mod_perl is not an option?

There is no reason that you could not use just simple CGI to do things that you can do with mod_perl. The only real difference is that mod_perl gives you a speed boost and easier access to apache's guts (rarely vital, often useful).

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:

#!/usr/local/bin/perl use lib '/path/to/my/files/perl/'; use MyWebApp; MyWebApp->go();
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.

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