Solved

How to install perl packages programatically

Posted on 2009-04-02
4
237 Views
Last Modified: 2012-05-06
HI,
i need to install some packages to run my perl script.
how to install these perl packages programatically using perl script
0
Comment
Question by:YUGA255
  • 2
4 Comments
 
LVL 3

Expert Comment

by:WeiXi
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):
http://search.cpan.org/~andk/CPAN-1.9304/lib/CPAN.pm

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

CPAN::Shell->install("Acme::Meta");

CPAN::Shell->install("NWCLARK/Acme-Meta-0.02.tar.gz");

Open in new window

0
 

Author Comment

by:YUGA255
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.
0
 
LVL 3

Accepted Solution

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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
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…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

911 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now