Arg - my brain hurts

Purdy on 2001-12-04T21:40:36

For the life of me, I cannot get around my current mod_perl problem - nothing I want to bother you with, but if you want to see the code so far, check it out.

I would like the BEGIN block to set up global variables for the life of the program (which I thought loaded up and ran in perpetuity [until the server stopped/restarted]). However, it seems the BEGIN block is run for each child process of the Apache server. And also if the child is recycled.

I don't think I'm explaining it properly... bottom-line: I would like the program to only setup the variables once - it would save some time in re-creating those global variables.

After my head stops hurting, I will check out PerlFreshRestart (or something like that) and also Apache::Registry (can i put global variables there?).

Jason


startup script loaded from conf file

modred on 2001-12-05T11:54:11

Did you try putting your initialization code into the startup script that is included from httpd.conf? The standard name of this when you compile mod_perl is startup.pl. I think anything loaded this way is once per server start which is what you seem to want.

Re:startup script loaded from conf file

Purdy on 2001-12-06T17:11:58

This was the right answer - thanks, modred! :)