in reply to Re: cpan error - module installation
in thread cpan error - module installation

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?

Replies are listed 'Best First'.
Re^3: cpan error - module installation
by marto (Cardinal) on Jul 28, 2017 at 14:49 UTC

    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.

        For clarity:

        dpetrov@vaio:~$ cpanm Catalyst Catalyst::Devel

        Here 'dpetrov' is the current logged in user and 'vaio' is the hostname of the system. '$' is the prompt symbol and '~' is the path to your users home directory in bash (e.g. /home/marto in my case).

        You don't type this in, it's simply for illustrative purposes. If you've followed the steps you should be able to install modules without issue, from your command line:

        cpanm Module::Name

        Substitute Module::Name for whatever you want to install.

Re^3: cpan error - module installation
by stevieb (Canon) on Jul 28, 2017 at 14:49 UTC

    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.