You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Karl Djemal <kd...@bear.com> on 2000/06/01 09:57:32 UTC

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

Posted by Karl Djemal <kd...@bear.com>.
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

Posted by Perrin Harkins <pe...@primenet.com>.
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