Auto Install modules if not installed?

R

rishid

Hi,

I am distrubuting a few perl scripts to my colleagues, but I was
wondering if there was someway to have a script, do a check if the
modules I need are installed if not, install them with the included ppd
files I am sending?

Running Active perl 5.8 and all will be Windows machines

Pretty much just want to do a check if module is installed do nothing,
else install it via the ppd file.

Thanks,

RishiD
 
C

Charles DeRykus

Hi,

I am distrubuting a few perl scripts to my colleagues, but I was
wondering if there was someway to have a script, do a check if the
modules I need are installed if not, install them with the included ppd
files I am sending?

Running Active perl 5.8 and all will be Windows machines

Pretty much just want to do a check if module is installed do nothing,
else install it via the ppd file.

I haven't used W2K in years but I once did something similar
with the module PPM. You could either install your bundled
..ppd files or go to one of the repositories. Here's a short
example although I'm not sure of the currency of the PPM code
any more:

[ unused in eons - no warranty, very likely needs revision ]

use PPM;
my $local_archive = '/path/to/local/ppd/archive';
PPM::AddRepository( "repository" => 'this_host',
"location" => $local_archive ,
"save" => 1 );

for my $mod ( qw/mod1 mod2 .... / ) {
eval "use $mod'; (
if ($@) {
PPM::InstallPackage( "package" => "$local_archive/$mod.ppd" )
or die "Aborting... $mod install failed: $PPM::pPMERR\n";
}
}

hth,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top