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

I know I have seen this, but I can’t remember where...

If you want to “install all of the CPAN modules that are ‘here,’ over ‘there,’ ” what’s the magic spell for obtaining the list of (non-core...) modules that are installed ‘here?’

Replies are listed 'Best First'.
Re: Isn't there a quick way to "install all the CPAN modules that are here..."
by CountZero (Bishop) on May 24, 2011 at 06:37 UTC
    The cpan-shell has an autobundle command.

    autobundle
    autobundle writes a bundle file into the $CPAN::Config->{cpan_home}/Bundle directory. The file contains a list of all modules that are both available from CPAN and currently installed within @INC. The name of the bundle file is based on the current date and a counter.

    You can then copy the bundle file to the other machine and feed it to cpan. It will then clone the first system to the second system.

    Of course, the bundle file will also contain core modules, but cpan is bright enough not to do any unnecessary installs.

    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

      Excellent.   “It’s all com - ing back to me now ...”   (Uhh, sorry for conjuring up Celine Dione so early in the morning.   You know that song’s gonna be stuck in your head, and mine, for the rest of the day ... urk.)   I knew that it was available, and that it was simple.   I presume that it will not be of concern that the target machine has an earlier Perl version (as it happens...) than the source machine does?   Oh, of course, of course ...

Re: Isn't there a quick way to "install all the CPAN modules that are here..."
by Khen1950fx (Canon) on May 24, 2011 at 05:57 UTC
    sitepods will display all the modules that are site-installed. stdpods lists all the modules that came with the system(core).
Re: Isn't there a quick way to "install all the CPAN modules that are here..."
by Anonymous Monk on May 24, 2011 at 07:00 UTC
    It doesn't matter if they're core or not, you want a bundle. Both cpan/cpanp and cpanm have a command for creating bundles
      Just looked at the documentation and source for cpanm and see no mention of a bundle feature.