How do I re-install a cpan-autobundle

2019-07-19 01:36发布

问题:

I'm working with backups at the moment and instead of backing up the full disks it would be much more efficient for me just to backup the configuration of the system. So for the perl-section of things I would like to have a way to list installed modules and later reinstall those modules if needed.

I read How do I get a list of installed CPAN modules? about how to get the list and when reading perldoc -l install I found this:

You can also use "cpan"'s "-a" switch to create an autobundle file that "CPAN.pm" understands and can use to re-install every module:

$ cpan -a

So I run cpan -aand the last two rows of the output is:

Wrote bundle file
    /home/ulf/.cpan/Bundle/Snapshot_2017_11_30_01.pm

And yes the file exists, but how do I use it to "re-install every module" on another host?

Note: I my have some preconceptions about this after working with requirement-files in pip so please bear with me.

回答1:

If you open that bundle file with a text editor or perldoc, you'll get instructions.

=head1 SYNOPSIS

perl -MCPAN -e 'install Bundle::Snapshot_2017_11_30_00'


标签: perl cpan