in reply to Help adding paths to @INC

There are four ways of fiddling with @INC without recompiling Perl:

  1. Set the PERL5LIB environment variable.
  2. Use the "-I" command-line option.
  3. Modify it in your Perl script itself, e.g. by explicitly pushing paths onto @INC in a BEGIN block, or via lib.
  4. In sitecustomize.pl, if your version of Perl has been compiled with support for it.
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Replies are listed 'Best First'.
Re^2: Help adding paths to @INC
by cstrawfield (Initiate) on Apr 22, 2012 at 23:48 UTC
    Thanks, tobyink. Your suggestion to use lib appeared to be the simplest solution, in the circumstances. Specifically, this:

    use lib '/usr/lib/perl5/site_perl'; # add path to @INC
    More info here