How to install perl packages programatically

Posted on 2009-04-02
Last Modified: 2012-05-06
i need to install some packages to run my perl script.
how to install these perl packages programatically using perl script
Question by:YUGA255
  • 2

Expert Comment

ID: 24050047
That depends on the installation mechanism you are using. I dare say, that CPAN is most widely used, but ActivePerl, for instance, comes with its own module installation mechanism.

For CPAN use this module (see code snippet below):

Note: Depending on the system and how perl is set up, the installation of perl modules might require root/admin-rights.
use CPAN;

Open in new window


Author Comment

ID: 24050204
Actually my requirement is like this,
actually i have to install some perl packages in a server system,but that server system does not have internet connection.
i have all the .tar.gz files of the required packages.
i need something like when i run a perl script it has to install all the .tar.gz what all are .tar.gz files i provided.

Accepted Solution

WeiXi earned 500 total points
ID: 24050279
> use CPAN;
> CPAN::Shell->install("NWCLARK/Acme-Meta-0.02.tar.gz");
should do the job for you.

Featured Post

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Removing file extension within a file. 4 94
Regex rule to match two different url 5 72
Perl Untar File 1 45
Log File Creation with Header and Footer 17 97
I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (,  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question