Hi folks,
 
I was wondering if there is a possibility to reload perl module (and I want reloaded module in all Apache children processes) by running reload-program once.
 
For example Apache::Reload must be set as PerlInitHandler, so it's handler method is run every time request comes to Apache. What I'd like to do is to reload specified (or all) module by running the program ONCE.
 
I tried using something like perl-status:
 
<Location /mod-perl-reload>
 SetHandler perl-script
 PerlHandler Apache::MyReloadModule
</Location>

where MyReloadModule's handler was deleting specified module from %INC and reloading it by require, but it didn't satisfy me becouse changes weren't seen in apache children processess (at least I think so),
 
so I wrote something like this in MyReloadModule:
 
sub handler {
    my $r = shift;
    Apache->request($r);
 
    .
    .    sending HTML
    .
 
    foreach my $k (keys %INC) {
        $r->print("$k<BR>");
    }
    $r->print("PID $$");
 
    $r->print("</BODY></HTML>");
 
}
and I realised that changes I have made to %INC in one child process aren't seen in another one.
 
So my problem can be set in another way:
Do apache children communicate between themselves?
 
Is it possible to write such a script as I wanted to write?
 
Maybe somebody already done this?
 
Thanks in advance,
Tomek Paterek
 

Reply via email to