Re: [SITE] Can't locate foo.pm in @INC

[prev] [thread] [next] [Date index for 2005/01/04]

From: Perrin Harkins
Subject: Re: [SITE] Can't locate foo.pm in @INC
Date: 00:05 on 04 Jan 2005
On Mon, 2005-01-03 at 15:15 -0500, David Price wrote:
> I am setting up a light/heavy reverse proxy.  I'm using ProxyRemoteAddr to
> capture the forwarded IP address of the client.

Are you talking about the sample My::ProxyRemoteAddr module from the
docs?  I doubt that this is actually related to the problem.

> The heavy version using Mod_Perl.

You should always tell us which version.  See
http://perl.apache.org/docs/2.0/user/help/help.html#Reporting_Problems

> If I add the 'use lib' statement to a startup script so it loads the library
> directory the problem will go away, as far as the limits of my testing are
> concerned.

I think what's happening here is that the @INC reverts to its original
value after the script is run, and "use lib" is only executed once, at
compile time.  That means that in later requests, the directory is not
in your @INC.  Most people load all modules at compile time (you
probably should too) so they don't see this.  The fix is just what you
described: do it in startup.pl or set PERL5LIB.

For more info:
http://perl.apache.org/docs/1.0/guide/install.html#Making_Your_Scripts_Find_the_Locally_Installed_Modules

- Perrin


        -- 
        Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html

[SITE] Can't locate foo.pm in @INC
David Price 20:15 on 03 Jan 2005

Re: [SITE] Can't locate foo.pm in @INC
Perrin Harkins 00:05 on 04 Jan 2005

Generated at 12:16 on 16 Jan 2005 by mariachi v0.52