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

Reply via email to