Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Install set of modules in new Perl

by Anonymous Monk
on Mar 15, 2019 at 22:10 UTC ( [id://1231328]=perlquestion: print w/replies, xml ) Need Help??

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

Hello

On macOS I use clone-modules command for perlbrew in order to reinstall a set of CPAN installed module in a new version of Perl. Now I need to work on Windows (Strawberry Perl, Portable, Berrybrew): is there any easy way to automate the installation of my set of CPAN module in the new Perl version? For now I am doing it manually... but as they are around 30 I guess a better method should be used...

Replies are listed 'Best First'.
Re: Install set of modules in new Perl
by stevieb (Canon) on Mar 15, 2019 at 23:23 UTC

    Taken from my post here, you can use bundles to gather all CPAN distributions installed, and then re-install them into your new perl installation:

    cpan -a ... Wrote bundle file /home/steve/.cpan/Bundle/Snapshot_2018_01_12_00.pm # move the Snapshot pm file to your ".cpan/Bundle" dir # switch to the new perl you want to install the distributions into cpan Bundle::Snapshot_2018_01_12_00.pm

    That example is on Linux, but it should be easy enough to follow.

    Note that I'm the author of berrybrew, and having the ability to 'clone' installed distributions from one perl instance into another is on my roadmap for this spring.

Re: Install set of modules in new Perl
by pryrt (Abbot) on Mar 15, 2019 at 23:24 UTC

    Hello. stevieb has "clone modules" in his TODO list, but I haven't seen any commits yet that indicate he's working on it. He's had a rather eventful life recently, and berrybrew isn't his primary focus: I don't blame him. In the past, I've added some small stuff to berrybrew, but I'm not even sure what all would be required to implement "clone modules", let alone how I'd go about it, so I unfortunately won't be able to help move this one forward.

    As a suggestion for how to improve upon "doing it manually", making a Bundle:: "module" helps. Hmm, mine's in a private svn repo, not in my github. Basically, all you need is a Makefile.PL that lists the prerequisites, and a dummy .pm, and you can then run cpanm --installdeps . (assuming you're in the right directory, and use cpanm; you can use the traditional perl Makefile.PL; make; make install sequence as an alternative). A simplified version of my Makefile.PL is below:

    edit: as a publically-available example, some users keep their bundle's on CPAN, such as Bundle::BDFOY, so you can see how someone much more experienced than I does it. (but I wouldn't recommend putting yours in CPAN, unless you've got a following, or think other people would actually be interested in your bundle.)

      "In the past, I've added some small stuff to berrybrew..."

      Your efforts go well above and beyond "some small stuff". You single-handedly put in the entire berrybrew use ... functionality (which I use very often), as well as revamped the entire test infrastructure to make it far more dynamic (and usable).

      My development of berrybrew became a lot more efficient after these significant pieces were added.

      Thanks again :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1231328]
Front-paged by davies
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2024-04-25 15:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found