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

dear monks,

how does perl interpreter set up @INC array? does it use config file or environment variable or some other means?

thanks!

Replies are listed 'Best First'.
Re: how is @INC set up
by ikegami (Patriarch) on Sep 08, 2008 at 23:11 UTC

    On non-Windows systems, the initial contents of @INC are hardcoded when Perl is built.
    On Windows systems, the initial contents of @INC are derived from the location of the perl executable.

    Env var PERL5LIB prepends to @INC. (See perlrun.)
    Perl command line option -I prepends to @INC. (See perlrun.)
    Perl module lib prepends to @INC.
    And @INC can be modified as any other array.

Re: how is @INC set up
by planetscape (Chancellor) on Sep 09, 2008 at 07:04 UTC