morgon has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I have a question pertaining to mod_perl 2.0.4 and Perl 5.10.0 on Linux:

In our project we have complied Perl with relocatable INC so that we can deploy it everywhere we want.

I have used that Perl to build mod_perl and now when I try to load a startup-script I get an error "Can't locate strict.pm in @INC".

This I assume is due to the fact that with relocatable INC Perl looks for standard modules relative to the location of the executable which in the case of mod_perl probably is the location httpd-executable, so of course it cannot find anything.

My workaround at the moment is to add a

PerlSwitches -I/sandbox/trunk/perl/lib/5.10.0
directive to the httpd.conf, but I wonder if there is a better way to do this...

So my questions are:

Am I right in assuming that this behaviour of mod_perl is due to the relocatable INC and what is the best way to ensure that mod_perl can then find the standard modules?

Many thanks!

Replies are listed 'Best First'.
Re: mod_perl and relocatable INC
by perrin (Chancellor) on Jul 13, 2009 at 16:29 UTC
    I've never heard of this problem before, but I guess it's possible that's the reason. I think your solution is fine. You could alternatively set PERL5LIB, but it's the same thing.