in reply to Re^2: change where CPAN places Modules - Help Please
in thread change where CPAN places Modules - Help Please

No thats good enough, thats the secret sauce right there

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"

Thats the stuff users without root use to install perl modules into a directory of their choosing

This is the documentation you need to read

PERL_MM_OPT, PERL5LIB, PERL_MB_OPT, PERL_MM_OPT, INSTALL_BASE, PERL_LOCAL_LIB_ROOT,

A root user doesn't need local::lib or perlbrew only sh Configure -Dprefix=~/p-5.18.0/

Replies are listed 'Best First'.
Re^4: change where CPAN places Modules - Help Please
by Anonymous Monk on May 02, 2017 at 01:07 UTC
    so for using that "sh Configure -Dprefix=~/p-5.18.0/" I have to re-install perl?

    -Rich

      so for using that "sh Configure -Dprefix=~/p-5.18.0/" I have to re-install perl?

      Yes

      See , you're not supposed to mess with your system perl, you're just supposed to use system tools to add modules to it (yum, apt ...)

      So you install a second/additional "local" perl ... and then it knows where to install modules without needing those extra env vars

      Root simply uses "/user/local/bin/cpan" to install modules into "/user/local/perl/..."

      Root tells his users to use "/user/local/bin/perl"

      All the users use "#!/user/local/bin/perl --" for shebang and things just work

      Now if the users want extra stuff from cpan they use PERL5LIB/INSTALL_BASE... and they don't bother root about it or other users