Auto Install modules if not installed?

Discussion in 'Perl Misc' started by rishid@gmail.com, May 18, 2005.

  1. Guest

    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
     
    , May 18, 2005
    #1
    1. Advertising

  2. In article <>,
    <> wrote:
    >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,
    --
    Charles DeRykus
     
    Charles DeRykus, May 19, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Curt_C [MVP]
    Replies:
    2
    Views:
    320
    Curt_C [MVP]
    May 18, 2004
  2. Learner
    Replies:
    4
    Views:
    2,128
    Learner
    Jan 27, 2006
  3. linkswanted
    Replies:
    1
    Views:
    997
  4. Replies:
    3
    Views:
    488
    Jason
    Apr 28, 2008
  5. Dave
    Replies:
    2
    Views:
    125
    Thomas 'PointedEars' Lahn
    Aug 10, 2004
Loading...

Share This Page