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

Note:This is sort of a continuation of an earlier question I had this node Problems with environment variables.

Alright I was using CPAN. It upgraded my version of perl from 5.6.0 to 5.6.1, but instead of upgrading the old vers. of perl(/usr/bin/perl) it installed itself in /usr/local/bin. All the pm's I download are now installed under the /usr/local. Now when I went to start apache it died, because it couldn't find the PM's it needed under the paths for the old/default version of perl. So, I renamed my old perl binary, and created a symbolic link to the new one, since the new binary(5.6.1) had the correct path information (I've checked it to be sure).

I now try to start apache again, and I get the EXACT same error message with the EXACT same search paths as the 5.6.0 version of perl, instead of the new 5.6.1 paths.

Not to be outdone, I then tried to modify my environment variables, with 'export PERL5LIB='and supplying it the appropriate paths. Then I try start apache. I get the same error message, EXCEPT this time it has the 5.6.0 AND the 5.6.1 paths listed. That means it has the correct paths (yes I check SEVERAL times for typos) AND the old ones, but for some reason it still can't find the PM's. I'm really perplexed on this one. Please help.

Brian

Edit: chipmunk 2001-08-18

Replies are listed 'Best First'.
(maverick) Re: Where does Apache get its search path
by maverick (Curate) on Aug 18, 2001 at 07:10 UTC
    The default include path is compiled into Apache. I don't know if this is the 'proper' way to do it (my mod_perl book is at the office and I'm not), but this does work.
    <perl> BEGIN { push(@INC,"/home/maverick/"); } </perl>
    Adding something like this to your httpd.conf or perl.conf file will cause @INC (the include path array) to be modified at server start time BEFORE it tries to do any PerlModule, require or use directives.

    /\/\averick
    perl -l -e "eval pack('h*','072796e6470272f2c5f2c5166756279636b672');"

Re: Where does Apache get its search path
by perrin (Chancellor) on Aug 18, 2001 at 08:22 UTC
    I assume you're talking about mod_perl, since it's easy to change which perl a CGI script is pointed at. With mod_perl, you need to recompile it when you upgrade Perl. It is linked to Perl at a deeper level than just a path, and no amount of @INC magic will fix it.