jeffthewookiee has asked for the wisdom of the Perl Monks concerning the following question:

Seeking Perl Knowledge/best practices for what I think is a pretty standard situation. We are attempting to upgrade the production version of Perl on several servers, using perlbrew. Perlbrew is working fantastic but we also need to make sure we get all of our CPAN module dependencies installed on the new installation of Perl. We do not currently maintain a list of module dependencies for our Perl apps, so we need a good way of making sure that everything makes it over into the new version of Perl. We tried the CPAN autobundle approach and it worked mostly, but seems to be failing consistently on 2-5% of the modules in the autobundle Snapshot file. Not sure if these files are actually used or not; we could invest a lot more man-hours into getting these modules to install but figured it would first be best to consult the Perl community. The core question is what's the best way to get an existing library of CPAN modules over into a new Perl installation and/or new machine entirely? Is there a tool that makes this a little less painful or are we relegated to CPAN install/troubleshoot migration cycle?
  • Comment on Transferring CPAN Modules between Environments

Replies are listed 'Best First'.
Re: Transferring CPAN Modules between Environments
by bergbrains (Acolyte) on Nov 07, 2011 at 21:23 UTC

    We've been going through this exercise, so I've also been looking for ways to do this and have come up with exactly nothing. We are upgrading to a new Perl and are breaking out not only our own code, but also perl and all of teh CPAN modules into dev, stage, and prod for a number of reasons, including the obvious. I just got finished syncing up two perlbrew installations of perl-5.14.2, for which I used autobundle. Ultimately, I use CPANPLUS and created bundles in both perls and did a diff on them, manually tidying up after multiple runs of installing teh autobundle into the new Perl.

    So, basically, to the best of my knowledge, the answer is no. There is no way to sync up cpan mods on separate perl installs. I've been contemplating building some tools to do just this, since we are moving toward testing in dev before installing in stage and testing in stage before installing into prod. I think I may approach it using something akin to autobundle, but plan to do some more research and give it some more thought before committing to an approach.

    One thing to consider is that we run each of our Perls under a different user, so, where one approach might be to have a single tool that would sync mods between the Perls, that breaks down when you have multple users involved. To that end, something that allows state to be passed from user to user appears to lean toward using the autobundle type approach.

    CPANPLUS probably won't be able to do the full upgrade in an automated fashion. While Perl module installation is much better than it ever has been IMHO, there are still some oddities that it can't address. Here are some examples that are the residual issues with my sync:

    1 0.15 0.20 File::MimeInfo::Rox P +ARDUS 2 1.80 1.008 Math::BaseCnv P +IP 3 0.44 0.45 Proc::ProcessTable D +URIST 4 0.7201 0.72 Shell F +ERREIRA 5 1.12 1.012 XML::Tidy P +IP

    Some mods use the normalized decimal and some don't. There are others taht append dates or seemingly arbitrary strings to the versions that mess things up too. And then there are just modules that won't pass tests that have to either be installed by force, or are best installed outside the context of the CPAN(PLUS)+ shell, and I haven't been able to get Proc::ProcessTable 0.45 to work properly for quite some time, though 0.44 works just fine,

Re: Transferring CPAN Modules between Environments
by Anonymous Monk on Nov 08, 2011 at 03:53 UTC