Clone or Install the Perl modules from one machine to another

Developers or system integrators install lot of Perl modules on their machines when they wanted to try with some applications or modules or APIs. But when they wanted to use the same installed modules to some other servers/machines they need to do the same exercise again on the other machines.

CPAN shell has an inbuilt feature to deal with this scenario.


perl -MCPAN -e "autobundle"

This will create a bundle file which will contain all installed modules available in the path of @INC

<user_home_directory>/.cpan/Bundle/Snapshot_2015_04_16_01.pm

Now copy that bundle file to any machine and run the below command to get all those modules available in the old machine.


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

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s