For DB access, since for Apache, it uses Apache::DBI and for anything else, normally DBI is used, I figure, I write _DB.pm to contain all the subroutines (no "use" or "package" statements in it), and MyWebDB.pm and MyDB.pm which both "use" _DB.pm, but Apache::DBI and DBI respectively. So, while an Apache application will "use" MyWebDB.pm and a regular Perl script MyDB.pm, I usually only have to modify one _DB.pm file.
But is it possible to write only one DB module that will work for both Apache and non-Apache applications?
Thanks.