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

I am logging in via root access to my dedicated server.

Running:

cpan

cpan> install Mod::what

and it is putting the modules in the root directory:
/root/perl5/lib/perl5/Mod/what.pm
like that... (Mod::what is not real of course)...

Anyhow, it is not putting it where @INC has locations.

So how do I, server wide, put that location ('/root/perl5/lib/perl5/') into @INC so every script I have on every website loads it, OR how do I change where CPAN is putting the modules and have it install them where @INC is looking, namely, in any of these directories where it says @INC includes: /usr/local/lib64/perl5 -> /usr/local/share/perl5 -> /usr/lib64/perl5/vendor_perl -> /usr/share/perl5/vendor_perl -> /usr/lib64/perl5 /usr/share/perl5

Either way. I don't have a preference. This is a dedicated server behind a very strong firewall, so neither will hurt anything.

I would appreciate your pointed advice.
best regards,
-Rich

  • Comment on change where CPAN places Modules - Help Please

Replies are listed 'Best First'.
Re: change where CPAN places Modules - Help Please
by Anonymous Monk on May 02, 2017 at 00:14 UTC
    Please post the output of perl -V
      This:

      %ENV:
      PERL5LIB="/root/perl5/lib/perl5:"
      PERL_LOCAL_LIB_ROOT=":/root/perl5"
      PERL_MB_OPT="--install_base /root/perl5"
      PERL_MM_OPT="INSTALL_BASE=/root/perl5"
      @INC:
      /root/perl5/lib/perl5/5.16.3/x86_64-linux-thread-multi
      /root/perl5/lib/perl5/5.16.3
      /root/perl5/lib/perl5/x86_64-linux-thread-multi
      /root/perl5/lib/perl5
      /usr/local/lib64/perl5
      /usr/local/share/perl5
      /usr/lib64/perl5/vendor_perl
      /usr/share/perl5/vendor_perl
      /usr/lib64/perl5
      /usr/share/perl5

      Or the whole thing?

      -Rich