in reply to Proper CPAN Installation

I would get rid of both and use http://perlbrew.pl. Perlbrew is a program that manages your whole perl environment. Most Unix variants rely on the Operating System installed Perl for whatever, so it is not safe to screw with.

Perlbrew lets you keep different version of Perl with different local cpan installations. It is really nice to have and solves your current dilemma, which is mostly a subjective decision. It is not going to hurt to have two .cpans, just annoying. Installing software of unknown origin as root, also annoying, and potentially subvertible. Installing as an unprivileged user, can only compromise ports 1025-65535, and everything that user has access to.

Updated: link

Replies are listed 'Best First'.
Re^2: Proper CPAN Installation
by syphilis (Archbishop) on Sep 22, 2015 at 04:34 UTC
    Perlbrew lets you keep different version of Perl with different local cpan installations

    I don't use perlbrew, but I expected it would be possible to configure it such that *all* perls it builds use the same .cpan location.
    My perls all use the same .cpan directory. It would really annoy me if I had to repeatedly download the same source tarball - one for each perl that I have.

    Cheers,
    Rob
      According to the perlbrew site, there is an option available for installing a cpanm instance that is shared across the different perlbrew perls.
      perlbrew install-cpanm
      I think it will store it's configuration and data files (such as sources) in ~/.cpanm. I do not see similar support for cpan. I have not used this feature of perlbrew, so if I'm not correct, I hope someone will correct me.

      "I don't use perlbrew, but I expected it would be possible to configure it such that *all* perls it builds use the same .cpan location."

      Nope! But this should not be a problem ... why? Because why are you installing multiple Perls? I install them so i can test the installation of my CPAN releases and as such, NOT having the same modules shared across multiple perls actually is a benefit to me, because i see what a completely fresh install of my module entails. (Did i really get that dependency correct?)

      As far as provisioning your installed perls via perlbrew ... just keep a record of the CPAN modules you use and install them all with one fell swoop: cpanm -n Dancer WWW::Mechanize YAML JSON etc. (and yes, i recommend skipping CPAN module tests because many authors do not care how long their tests take to complete.) This is where your Puppet/Chef/cfEngine3 manifest comes into play ... you do have one, don't you? :)

      jeffa

      L-LL-L--L-LL-L--L-LL-L--
      -R--R-RR-R--R-RR-R--R-RR
      B--B--B--B--B--B--B--B--
      H---H---H---H---H---H---
      (the triplet paradiddle with high-hat)
      

        syphilis: ... *all* perls it builds use the same .cpan location.... jeffa: Nope! ...

        Try it, its very possible, it works with cpan/cpanp/cpanm