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


in reply to How to change @INC permanently?

And yet another solution is to make use of the myriad paths that Perl scans for modules in. </p

Notice that Perl scans /etc/perl by default. Most distributions of Linux don't put anything there, so why not just softlink the directory structure your modules live under into /etc/perl?

Replies are listed 'Best First'.
Re^2: How to change @INC permanently?
by Qiang (Friar) on Aug 24, 2005 at 14:47 UTC
    Notice that Perl scans /etc/perl by default.

    doesn't seem to be the case on my machines. if it were, that might be a nice trick to use.

    on debian perl 5.8.7

    $ perl -e 'print join "\n",@INC' /etc/perl /usr/local/lib/perl/5.8.7 /usr/local/share/perl/5.8.7 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl /usr/local/lib/perl/5.8.4 /usr/local/share/perl/5.8.4
    on RH perl 5.8.0
    $ perl -e 'print join "\n",@INC' /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0
    on solaris perl 5.00503
    > perl -e 'print join "\n",@INC' /usr/perl5/5.00503/sun4-solaris /usr/perl5/5.00503 /usr/perl5/site_perl/5.005/sun4-solaris /usr/perl5/site_perl/5.005