[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-modperl
Subject:    Re: mod_perl problems - require file
From:       aj2taylo <andrew () andrewjtaylor ! com>
Date:       2006-12-13 19:06:28
Message-ID: 7859199.post () talk ! nabble ! com
[Download RAW message or body]


Thankgs for all the help guys.

Through some digging, I found some new files that were calling "require
moduleX.methods", which seem to be the culprit.  

Thanks again!



Perrin Harkins wrote:
> 
> aj2taylo wrote:
> > Correct, moduleX.methods has sub routines defined, but is not itself a
> > package.  This is all part of a legacy system, and moduleX.pm is used as
> > a
> > form handler, so moduleX.methods exists purely for architectural reasons
> > (separating certain functions from the form handling functions).
> 
> Are you doing a "require moduleX.methods" in some other file too?  As 
> Jeff and Philip explained, this is what can get you in trouble, since it 
> will only load the first time it is required in a particular perl 
> interpreter.
> 
> > This architectural approach has worked fine for years, and as stated
> > before,
> > there were no changes to moduleX.methods or changes to the top of
> > moduleX.pm
> > (where the require stmt is). 
> 
> You may have just started requiring this module in some other file, or 
> added a modified copy of your moduleX form handler somewhere, or changed 
> what you load in startup.pl.  Then it will be a matter of chance which 
> one gets loaded first in each process, and the second to get loaded will 
> fail to require this file correctly.
> 
> A quick and bad fix for this is to change your require statement to this:
> 
> BEGIN {
> do 'moduleX.methods.pl';
> }
> 
> That will ignore %INC and load it again anyway.
> 
> A better solution is to put the moduleX.methods subs into a package. 
> That will save memory because it avoids loading them more than once in 
> separate namespaces.
> 
> - Perrin
> 
> 

-- 
View this message in context: \
http://www.nabble.com/mod_perl-problems---require-file-tf2810466.html#a7859199 Sent \
from the mod_perl - General mailing list archive at Nabble.com.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic