http://www.perlmonks.org?node_id=190585


in reply to Compiling Perl with correct values in @INC

If you can't rebuild the perl executable or you want to keep certain perl modules in a different directory for other reasons, just stick--

  use lib "/path/to/perl/modules";

...at the beginning of your script.

  • Comment on Re: Compiling Perl with correct values in @INC

Replies are listed 'Best First'.
Re^2: Compiling Perl with correct values in @INC
by tadman (Prior) on Aug 16, 2002 at 10:12 UTC
    Which actually works quite well using mod_perl:
    <Perl> use lib "/my/modules/path"; </Perl>
    As a note, you have to build that thing properly when compiling it in:
    % perl Makefile.PL EVERYTHING=1
Re: Re: Compiling Perl with correct values in @INC
by Courage (Parson) on Aug 16, 2002 at 10:54 UTC
    this will work but only in cases when perl will find "lib.pm" which, in turn, requires "Config.pm" and "Exporter.pm".
    That said, @INC must be sane in this case.

    I agree that @INC should *always* be sane, but what you will do if it is not? :)

    Warmest wishes,
    Courage, the Cowardly Dog