in reply to perlbrew and cpan

Yes, you can use CPAN inside a perlbrew context.

You can run CPAN under sudo but that is probably a bad idea. I think you will mess up your system's Perl that way.

Runing CPAN (which is actually just another Perl script) without sudo will keep your install within the Perl instance you are running under at that moment. That's actually the whole idea of using perlbrew.

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^2: perlbrew and cpan
by Anonymous Monk on Aug 07, 2014 at 08:40 UTC

    Thx.

    So it looks like I may have messed up my cpan and my system perl. And there is no good way to fix it except to restore from backup?

    lc

      You can fix the file ownership as follows:

      sudo chown -R $USER "${PERLBREW_ROOT:-$HOME/perl5/perlbrew}"

      The following fixes the group too, assuming the group name should be the same as your user name:

      sudo chown -R $USER:$USER "${PERLBREW_ROOT:-$HOME/perl5/perlbrew}"

      You didn't say how you messed up your system perl, so I can't offer any advice on how to fix it.

      So it looks like I may have messed up my cpan and my system perl. And there is no good way to fix it except to restore from backup?

      Why does it look that way to you?

        I find it strange that perlbrew allows the system perl to be updated; regardless that it's been ran with a sudo.

        Shouldn't that happen only after perlbrew off had been given? when the system perl is available.