Dave Sherohman <esper at sherohman.org> writes:

> Using mod_perl, you can create a startup script (using the PerlRequire or
> PerlModule directive) which will run at server startup, when the mod_perl
> environment is set up.  Anything it does (like setting up DB connections or
> precaching data) is then inherited by all child processes.
> 
> Also, individual perl modules are persistent within each child process.
> One of the things frequently stressed in the documentation I've seen
> on writing perl modules for apache is that you have to clean up after
> yourself, because the next request delegated to that child will have
> whatever environment you leave behind.  It seems that many CGI programmers
> are in the habit of assuming that the world ends when their script does,
> so they don't bother closing files, etc.

I've never understood what mod_perl itself is really good for; the
documentation didn't communicate anything to me.  (I had at the time
been writing Perl CGI scripts for years, making use of Perl 5 and
objects.  I had also run various web servers for several years.  I.e.,
perhaps I was ignorant in the area, but I thought I had reason to
believe otherwise.)  I installed it because it was a prereq for
embperl, if I remember correctly (I had originally hoped that it would
*be* embperl).

I've never written an Apache module; maybe the problem is I don't
know I should be writing Apache modules for functions specific to
particular web sites I'm developing? 

(Um, reading this I guess it could be interpreted as a slam at
mod_perl and stuff.  My actual intent is to try to get some pointers
to understand the stuff here I don't currently understand.)
-- 
David Dyer-Bennet      /      Welcome to the future!      /      dd-b at dd-b.net
SF: http://www.dd-b.net/dd-b/          Minicon: http://www.mnstf.org/minicon/
Photos: http://dd-b.lighthunters.net/