On Nov 8, 2007, at 1:07 PM, Octavian Rasnita wrote:

> From: "Boysenberry Payne"
>>> What should I do if I want to load the classes after the server
>>> forks?

>> There are many phases after the fork, the most commonly used is the
>> PerlResponseHandler phase

> Do I understand correctly that even the modules specified in
> httpd.conf with
> PerlResponseHandler Module::Name
> are loaded before the server forks, because they are loaded with
> PerlModule Module::Name
> or in a startup.pl file?

Correct. Using `PerlModule Module::Name` in the httpd.conf file is
the same as
`use Module::Name();`in the startup.pl file. All of the
configurations in those files
are run before the fork and before any other accessible phases.

> But what if the module Module::Name "use" or "require" other modules?
> Are they also loaded before the server forks, or I need to load
> them with "PerlModule ..." in httpd.conf?

Good question. I think it might depend on how the requires/uses are
in the scripts that are included. I'm pretty sure any use statements
that are
scoped globally will be included in each forked copy of the server.
To insure
they are included it is suggested you add your use statements to the
file. Probably including your use/require statements in a BEGIN {}
block will
help to insure they are pre-compiled.