http://www.perlmonks.org?node_id=1142755


in reply to Re^2: Proper CPAN Installation
in thread Proper CPAN Installation

"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)

Replies are listed 'Best First'.
Re^4: Proper CPAN Installation
by Anonymous Monk on Sep 22, 2015 at 22:45 UTC

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

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

      For example with cpanp its by default

      cpanplus\01mailrc.txt.gz cpanplus\02packages.details.txt.gz cpanplus\03modlist.data.gz cpanplus\db.sql cpanplus\5.16.1\build\ack-2.08\t\swamp\Makefile.PL cpanplus\authors\id\R\RU\RURBAN\CHECKSUMS cpanplus\authors\id\R\RU\RURBAN\Compress-Bzip2-2.17.tar.gz cpanplus\install-logs\ack-1.96-1371720568.log

      the sources are shared, the build directories are not

      You can change location from "$HOME" with PERL5_CPANPLUS_HOME


      With cpanm its similar , to keep it from downloading source files over and over again (default) just tell it to cache them

      export PERL_CPANM_OPT="--cascade-search --save-dists=$HOME/.cpanm/cach +e --mirror=$HOME/.cpanm/cache --mirror=http://search.cpan.org/CPAN"

      With cpan its also very similar, $HOME by default ... can use https://metacpan.org/pod/cpan#CPAN_OPTS to use -j alternate/configfile ... here is what installing CGI using 3 different perls looks like

      .cpan\FTPstats.yml .cpan\histfile .cpan\Metadata .cpan\build\CGI-4.21-0lIz7E.yml .cpan\build\CGI-4.21-f0xo4H.yml .cpan\build\CGI-4.21-v1xWJv.yml .cpan\build\CGI-4.21-0lIz7E\Changes .cpan\build\CGI-4.21-f0xo4H\Changes .cpan\build\CGI-4.21-v1xWJv\Changes .cpan\CPAN\MyConfig.pm .cpan\sources\MIRRORED.BY .cpan\sources\authors\01mailrc.txt.gz .cpan\sources\authors\id\L\LE\LEEJO\CGI-4.21.tar.gz .cpan\sources\authors\id\L\LE\LEEJO\CHECKSUMS .cpan\sources\modules\02packages.details.txt.gz .cpan\sources\modules\03modlist.data.gz

      You don't need perlbrew for any of this, and its not exactly a secret

      I don't use cpanp or cpan anymore, I mostly use cpanm with the default settings (no caching)

        That is a terrible "solution" to what is not even a problem.
      Here's a better idea: post the proof that you can.

        Here's a better idea: post the proof that you can.

        Its all very documented, but I'm already working on the "proof"