in reply to cpan error - module installation

Welcome. The user you're running this as doesn't havbe permission to write to this directory. A solution is listed in perlfaq8 under How do I keep my own module/library directory?. Consider using cpanm over cpan, it's faster. See also Keep your libraries organized.

Replies are listed 'Best First'.
Re^2: cpan error - module installation
by ic23oluk (Sexton) on Jul 28, 2017 at 14:41 UTC

    Thanks for your reply, but I dont really understand, because this website recommends the module local::lib in order to set the installation settings, but i obviously get the same error when trying to install it.

    Isn't there a simple way to give the permission?

      You could use sudo to run the cpan command, but you may want to leave the system perl alone. Did you look at the second link:

      curl -L http://cpanmin.us | perl - -l ~/perl5 App::cpanminus local::lib

      "This will install either cpanminus and local::lib (and all other required modules) locally into $HOME/perl5 directory."

      Follow the other config step which follows and you should be fine. If you look at local::lib it describes the boostrapping technique used.

      Yes, you can use sudo to run the command.

      BE WARNED that it can be very dangerous to modify your system Perl in any way, and in some cases can render your machine inoperable.

      You're best to do something along the lines of what marto said, or install and use Perlbrew, which is a Perl management system, allowing you to install any versions you want, all in the safety of your home directory.