Script to install Perl Modules


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script to install Perl Modules
# 1  
Old 04-24-2013
Script to install Perl Modules

Hi guys,

I need to upgrade perl modules on about multiple machines. I'm writing a for loop for it.

Code:
for i in 1 2 3 4 5 6; 
do 
   ssh server$i " sudo cpan Mozilla::CA, 
   sudo cpan LWP::UserAgent, 
   sudo cpan LWP::Protocol::https, 
   sudo cpan IO::Socket::SSL, 
   sudo cpan Net::SSL, 
   sudo cpan Net::SSLeay, 
   sudo cpan Net::FTPSSL"; 
done

I haven't tested it but I think that should work for most of the modules. The problem is a couple of the modules ask for user input. Now I'm not going to be doing anything fancy. I would just select no and press enter. Can anyone give me a clue how to add that to my loop/script. There must be a quick and easy way to do that. lol.

Last edited by scj2012; 04-25-2013 at 10:07 AM..
# 2  
Old 04-25-2013
First thing: there appears to be a logical error in your for-loop. The following code would do <whatever> 6 times. In your case, it would run all of the ssh and cpan commands 6 times. I don't think that's what you want.
Code:
for i in 1 2 3 4 5 6
do
    <whatever>
done

Also, read about PERL_MM_USE_DEFAULT environment variable and cpanminus.
# 3  
Old 04-25-2013
Quote:
Originally Posted by balajesuri
First thing: there appears to be a logical error in your for-loop. The following code would do <whatever> 6 times. In your case, it would run all of the ssh and cpan commands 6 times. I don't think that's what you want.
Code:
for i in 1 2 3 4 5 6
do
    <whatever>
done

Also, read about PERL_MM_USE_DEFAULT environment variable and cpanminus.
I've fixed my code. So it shouldn't run all the ssh and cpan commands six times.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

How to automatically install all modules required by a script from CPAN?

Having a script.pl how can I automatically download from CPAN all required modules and install and update as required? Something like "emerge -uDNav world" for the perl? ---------- Post updated at 05:38 PM ---------- Previous update was at 05:28 PM ---------- Doesn't matter I've found it ... (6 Replies)
Discussion started by: Tribe
6 Replies

2. Shell Programming and Scripting

perl modules installation

I have installed perl in windows. Now I would like to install spreadsheet::xlsx & DateTime::Format::Excel modules(also few more) at a time instead of installing them seperately. Could you please let me know how to install more than 1 module as a batch file in windows OS ? Thanks in... (5 Replies)
Discussion started by: giridhar276
5 Replies

3. Shell Programming and Scripting

how to create custom modules in perl and how to import all modules with single command?

I have some custom functions which i want to use in perl Scripting all time. i want to How to create modules in perl and how to import them. Also if i create 15 modules and i want to > import all at once then how can i import? (0 Replies)
Discussion started by: Navrattan Bansa
0 Replies

4. Shell Programming and Scripting

Unable to install perl XML and EXCEL modules in windows XP.

Hi, I am using perl 5.12. I want to install XML modules and Excel modules which is from perl in windows. I am using ppm to install these perl modules. My proxy is this: mtd.ixs.ibab.com/proxy.pac (with http in the beginning) I used this to set but i unable to download any pakage, Using... (5 Replies)
Discussion started by: vanitham
5 Replies

5. Shell Programming and Scripting

How to install perl modules in Solaris

Hi All, How to install the perl modules in Solaris? pwd /eweiquu/ocsta/lib/XML-Simple-2.18 and bash-3.00# perl Makefile.PL Checking installed modules ... XML::Parser is installed, it will be used by the test suite Writing Makefile for XML::Simple and then the readme file says,you... (2 Replies)
Discussion started by: Damon_Qu
2 Replies

6. Shell Programming and Scripting

How to manage several versions of Perl modules during the install?

Hello, I would really appreciate any advice on this issue: My Perl Module Environment: /usr/lpp/perl/lib/5.8.7 => has the Perl modules that come with the base Perl installation. Comes first in @INC concatination. /usr/lpp/perl/lib/site_perl/5.8.7 => has all my installed Perl modules... (1 Reply)
Discussion started by: genya01
1 Replies

7. Shell Programming and Scripting

Install modules on strawberry perl

Hi, I'm using strawberry perl on windows 7 rc, and for the past few days I haven't manage to install any modules. I understand that I have to download the module from cpan, which I do, afterwards I have to open cmd, change directory to where I have extracted the module, and type: perl... (0 Replies)
Discussion started by: byte1918
0 Replies

8. Shell Programming and Scripting

How to install perl modules

Hi. i installed perl 5.8.8.822 in my D: drive(windows xp).When im trying to install IO-Stringy.pm module( or any module for tat matter ) it is getting installed in 'c:\temp\please run installed script' folder no matter from where ever i run the ppm installation.The path variable is set to... (3 Replies)
Discussion started by: Anuj8584
3 Replies

9. UNIX for Dummies Questions & Answers

installing perl modules

I resulted to using /usr/sfw/bin/gmake to install my perl modules until i ran into a problem installing perl/Tk Tk-804.028 gmake: Entering directory `/export/home/Tk-804.028/pod' Sorry no HTML building yet gmake: Leaving directory `/export/home/Tk-804.028/pod' I dont unstand what the error... (2 Replies)
Discussion started by: jameskay
2 Replies

10. Shell Programming and Scripting

Installing Perl Modules

I have a script that uses the File::Listing module. I am trying to install it, but I read the ReadMe and it states that the following modules should be installed first: URI MIME-Base64 HTML-Parser libnet Digest-MD5 Compress-Zlib I am very new to Perl and would apprciate anyone's input on... (1 Reply)
Discussion started by: ssmiths001
1 Replies
Login or Register to Ask a Question