in reply to Why is cpanm installing Perl5 modules in the wrong spot?
cpanm plays it safe by default to avoid interfering with the system Perl, but it does give hints of how to circumvent this e.g.
i.e. run it as a root or with the --sudo option, but really this is the less safe option.+% cpanm -n Attempt ! ! Can't write to /usr/local/share/perl5 and /usr/local/bin: Installing + modules to /home/arun/perl5 ! To turn off this warning, you have to do one of the following: ! - run me as a root or with --sudo option (to install to /usr/local +/share/perl5 and /usr/local/bin) | - run me with --local-lib option e.g. cpanm --local-lib=~/perl5 ! - Set PERL_CPANM_OPT="--local-lib=~/perl5" environment variable (i +n your shell rc file) ! - Configure local::lib in your shell to set PERL_MM_OPT etc. ! --> Working on Attempt Fetching http://search.cpan.org/CPAN/authors/id/M/MA/MARKF/Attempt-1.0 +1.tar.gz ... OK Configuring Attempt-1.01 ... OK Building Attempt-1.01 ... OK Successfully installed Attempt-1.01 1 distribution installed
Also you can avoid adding a 'use lib ...' by setting the PERL5LIB env variable (which looks already set going by what you've shown above).
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Why is cpanm installing Perl5 modules in the wrong spot?
by hippo (Bishop) on Feb 07, 2021 at 17:17 UTC | |
by dsheroh (Monsignor) on Feb 08, 2021 at 08:19 UTC | |
Re^2: Why is cpanm installing Perl5 modules in the wrong spot?
by cormanaz (Deacon) on Feb 08, 2021 at 15:19 UTC |
In Section
Seekers of Perl Wisdom