Hello,

I've two quick and perhaps silly questions. I'm preloading a whole lot
of modules in my startup script. In fact, some of the stuff I'm
preloading aren't .pm modules, they're .pl libraries I want to 
"require" rather than "use". Do I have to wrap the require statements 
inside a BEGIN {}
block in order for them to be correctly preloaded for children, or
perhaps it doesn't matter and I can just require them at the runtime
of the startup script and not its compile time?

(my guess is that requiring at runtime is fine, since both compile
time and runtime of that script happen while processing the PerlRequire
directive in the config file, but perhaps I'm missing something here?)

The second question is about restarting the server. My httpd.conf file
has only one perlmod-related directive: a PerlRequire of my startup
script, and nothing more. The startup script uses Apache->httpd_conf()
to execute a whole bunch of other crucial config directives, like
DocumentRoot and setting Perl*Handlers. This is by design and is very
convenient to me. However, it doesn't work across restarts, either
regular or graceful (HUP or USR1). I thought of using a 
PerlRestartHandler to call a subroutine which would execute the same
Apache->httpd_conf commands, but I couldn't quite figure out when 
exactly during restart these commands would be sent to Apache, and 
whether it might mess some complex configs (e.g. if there're several
virtual servers, in context of which one of them will DocumentRoot
be processed, if it's set in a callback called by a RestartHandler?).

So the way I solved it was by appending to the end of my startup script 
a statement deleting it from %INC: delete $INC{"/path/to/script.pl"};
Then after restart the script is run again and all the 
Apache->httpd_conf directives are executed. Is that a reasonable way
to solve this problem, or does it have some gotchas/drawbacks I'm
not aware of?

Many thanks in advance,
Anatoly.

--
avva

-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html

Reply via email to