Re: Changes to module code only take effect if perl program updated
The penny's dropped! I now understand what you are getting at. Thanks for the help. Regards, Karl Perrin Harkins wrote: > Karl Djemal wrote: > > Thanks for the reply. I'm not quite sure what you are asking here - may be > > what I asked wasn't to clear. > > I was asking if you import any subs or variables from MyModule.pm. If > you don't know what I mean, then you probably don't. > > > I'm using Apache::Registry as a PerlHandler to run my perl CGI script. This > > perl program in turn does a use MyModule. What I don't understand is that I > > can see my perl module 'MyModule.pm' get reloaded if I change it, but the > > changes are not picked up until I update my perl program. > > > > It is when I update my perl program I start to see the 'Subroutine... > > redefined..' warnings. > > > > Does any one know why the parent httpd process doesn't reload my module (could > > it be that it does, but doesn't record this in the log file?). > > It definitely sounds like inlined subroutines to me. When your > Apache::Registry script got compiled, it inlined some subs from > MyModule.pm for performance reasons. They won't get redefined until > your Registry script gets compiled again. This isn't related to the > parent process. Looks like you'll have to touch the file, or do some > hacking on StatINC to make it unload your Registry script when it > reloads your modules. > > - Perrin *** Bear Stearns is not responsible for any recommendation, solicitation, offer or agreement or any information about any transaction, customer account or account activity contained in this communication. ***
Re: Changes to module code only take effect if perl program updated
Karl Djemal wrote: > Thanks for the reply. I'm not quite sure what you are asking here - may be > what I asked wasn't to clear. I was asking if you import any subs or variables from MyModule.pm. If you don't know what I mean, then you probably don't. > I'm using Apache::Registry as a PerlHandler to run my perl CGI script. This > perl program in turn does a use MyModule. What I don't understand is that I > can see my perl module 'MyModule.pm' get reloaded if I change it, but the > changes are not picked up until I update my perl program. > > It is when I update my perl program I start to see the 'Subroutine... > redefined..' warnings. > > Does any one know why the parent httpd process doesn't reload my module (could > it be that it does, but doesn't record this in the log file?). It definitely sounds like inlined subroutines to me. When your Apache::Registry script got compiled, it inlined some subs from MyModule.pm for performance reasons. They won't get redefined until your Registry script gets compiled again. This isn't related to the parent process. Looks like you'll have to touch the file, or do some hacking on StatINC to make it unload your Registry script when it reloads your modules. - Perrin
Re: Changes to module code only take effect if perl program updated
Hi Perrin, Thanks for the reply. I'm not quite sure what you are asking here - may be what I asked wasn't to clear. I'm using Apache::Registry as a PerlHandler to run my perl CGI script. This perl program in turn does a use MyModule. What I don't understand is that I can see my perl module 'MyModule.pm' get reloaded if I change it, but the changes are not picked up until I update my perl program. It is when I update my perl program I start to see the 'Subroutine... redefined..' warnings. Does any one know why the parent httpd process doesn't reload my module (could it be that it does, but doesn't record this in the log file?). Regards, Karl Perrin Harkins wrote: > On Wed, 31 May 2000, Karl Djemal wrote: > > > I'm trying to get up to speed with mod_perl and have been playing around > > with Apache::StatINC so that any perl modules I update get reloaded. > > >From what I can see in the error_log file it does get re-loaded, but the > > changes don't seem to take effect until I touch my perl program that > > 'uses' this module. Why? > > Does your Apache::Registry script import anything from this module? If > not, it's possible that perl has in-lined your module's subroutines in the > Registry script as an optimization during compiling. Those warnings you > mentioned usually indicate that. > > - Perrin *** Bear Stearns is not responsible for any recommendation, solicitation, offer or agreement or any information about any transaction, customer account or account activity contained in this communication. ***
Re: Changes to module code only take effect if perl program updated
On Wed, 31 May 2000, Karl Djemal wrote: > I'm trying to get up to speed with mod_perl and have been playing around > with Apache::StatINC so that any perl modules I update get reloaded. > >From what I can see in the error_log file it does get re-loaded, but the > changes don't seem to take effect until I touch my perl program that > 'uses' this module. Why? Does your Apache::Registry script import anything from this module? If not, it's possible that perl has in-lined your module's subroutines in the Registry script as an optimization during compiling. Those warnings you mentioned usually indicate that. - Perrin
Changes to module code only take effect if perl program updated
I'm trying to get up to speed with mod_perl and have been playing around with Apache::StatINC so that any perl modules I update get reloaded. >From what I can see in the error_log file it does get re-loaded, but the changes don't seem to take effect until I touch my perl program that 'uses' this module. Why? The other thing I notice in the error_log file (after I have touched my perl program) are warnings such as 'Subroutine CounterMain redefined at (eval 24) line 4'. Finally, I never notice the parent httpd process reload my module always the child processes - as per the error_log file eg: Apache::StatINC: process 25685 reloading Counter.pm Any help, advice, explanation would be appreciated. I am using the following : apache 1.3.12, mod_perl 1.24, perl 5.6.0 on Solaris 2.6 I've added the following to httpd.conf : # # For Karl's testing # Alias /karlperl//export/apache/karltest/perl/ PerlSetEnv PERL5LIB/export/apache/karltest/perl PerlSetEnv PERLDB_OPTS "NonStop=1 LineInfo=/tmp/karltest.db.out AutoTrace=1 frame=2" PerlWarnon PerlModule Apache::Registry PerlModule Apache::DB PerlModule Apache::StatINC # PerlFixupHandler Apache::DB SetHandler perl-script PerlHandler Apache::Registry Options ExecCGI PerlSendHeader On PerlInitHandler Apache::StatINC PerlSetVar StatINCDebug On #PerlSetVar StatINC_UndefOnReload On #order mutual-failure #allow from 165.168.176.23 Thanks Karl *** Bear Stearns is not responsible for any recommendation, solicitation, offer or agreement or any information about any transaction, customer account or account activity contained in this communication. ***