in reply to Re^5: perlbrew and cpan
in thread perlbrew and cpan

I don't have access to my Linux-system with perlbrew now, so read with caution.

Perlbrew's genius "trick" is to re-link perl to whatever version of perl you made active (there is more involved than just that, but it is the basis).

When you sudo you elevate yourself to the level of the admin and it may be that it also messes with your links or your environment or such. Without sudo I cannot touch the system Perl, with sudo that is one safety lock that is missing and I'd rather not take any chances. That's why I never do a sudo install of Perl-modules. Perhaps I am overcautious, but better safe than sorry.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

My blog: Imperial Deltronics

Replies are listed 'Best First'.
Re^7: perlbrew and cpan
by marto (Cardinal) on Aug 07, 2014 at 15:15 UTC

    From perlbrew:

    "By default, perlbrew builds and installs perls into $ENV{HOME}/perl5/perlbrew directory. To use a different directory, set this environment variable in your bashrc to the directory in your shell RC before sourcing perlbrew's RC."

    They'd have to have deliberately made some very poor configuration changes for perlbrew to nuke a system perl.

      perlbrew is quite safe, but the whole issue was about using sudo cpan.

      I am not sure that by pretending to be the superuser you still use the links and paths of yourself as a regular user. If all of a sudden perl no longer points to the perl installation in your home directory, but rather to the system perl, you could be in for a nasty surprise down the road.

      CountZero

      A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

      My blog: Imperial Deltronics

        Faceplam. Ignore me. Of course, you are correct. I'll go back to sleep now.