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


in reply to cpanm --sudo installs to /root/perl5 instead of /usr

What am I missing?

Probably some kind of Config entry -- see perl "-V:.*?usr.*?" and   perl "-V:install.*" -- it all works off of Config and these overrides

Re: CPAN won't install into personal directory; probably an o conf problem, Re: My favorite pitfall: setting up CPAN
perl -I/home/user/stuff/lib/perl5 -S myfoobar.pl
perl -Mlib=/home/user/stuff/lib/perl5 -S myfoobar.pl

export PERLLIB=/home/user/stuff/lib/perl5
myfoobar.pl

export PERL_MM_USE_DEFAULT=1
export PERL_MB_OPT=--install_base /home/user/stuff
export PERL_MM_OPT=INSTALL_BASE=/home/user/stuff
export AUTOMATED_TESTING=0

cpan -fi Module Module Module Module Module Module

cpanp -i Module Module Module --allow_build_interactivity=0 --skiptest=0 --force --prereqs=1 --no_update=1