Modperl query

David Dick david_dick at
Fri Jul 4 04:45:24 CDT 2003

AFAIK, the short answer is yes, the reloaded subs would only be visible 
in the httpd process that re-executes the code in the BEGIN block.  Is 
this a problem?  Do the httpd processes check table X at the start of 
every response phase, or are you using signals and need to know if you 
need to signal one mod_perl process or every one, or have i missed the 
point entirely?  What do you want to happen? :)


Brendon Oliver wrote:

>Hi all,
>I have a few perl modules which are loaded up when apache starts (ie. in 
>httpd.conf: PerlScript /path/to/  where "use"s a number 
>of modules).
>Now, a couple of these modules have BEGIN blocks which query some postgresql 
>database tables, then using the query results, dynamically create subroutines 
>(and constants) by manipulating the perl symbol table.  This all works fine - 
>these subs are visible to all other modules which need them, and are shared 
>across all httpd processes.
>If the contents of table X changes later on, I could re-execute the code from 
>the BEGIN block which would recreate the dynamically-generated subroutines.
>So there's the query: am I right in presuming that the re-loaded subs would 
>only be visible in the httpd process in which this executes?  I  expect that 
>because the other httpd processes were forked by apache _after_ the modules 
>were loaded, the only way to get this table change recognised by all 
>processes would be to restart apache?
>Thoughts anyone?
>Thanks & regards,
>- Brendon.

More information about the Melbourne-pm mailing list