The "housekeeping" I refer to is following the "rules" of mod_perl. Start by nosing around the perl.apache.org site. PERL is even worse than "BASIC" for encouraging bad programming habits, and the first thing you should do in writing programs is "use strict" and try to get the programs to run under mod_perl. If you can, then you've declared all your variables, you've given thought to scope and allocation and deallocation of processes and threads.