Smart questions
Smart answers
Smart people
Join Tek-Tips Forums
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Installing Modules

How do I add PPM repositories?
Posted: 24 Apr 03 (Edited 6 Feb 05)

If you are using PPM (Perl Package Manager) from ActiveState, you may only be using ActiveState own repository to grab and install CPAN modules. However, there are many more repositories around the world, which hold many modules and packages that ActiveState haven't yet loaded into their repository.

By adding these extra repositories, when you type 'install <package>', instead of just looking in the ActiveState repository, PPM will search all the repositories in your list to find '<package>'. Below are instructu=ions of how to add the 11 most widely used repositories to your version of PPM.

PPM version 3:

The latest version of PPM now uses a different syntax to add repositories, so if using an older version see the next section.

Start your copy of PPM, either from the command line or via Start->Run and typing in PPM3. You should then get a nice black command window (the DOS window), which you should enter the following:

PPM> rep add DevelopHelp http://ppd.develop-help.com/ppd/
PPM> rep add Roth http://www.roth.net/perl/packages/
PPM> rep add PTK http://www.xray.mpe.mpg.de/~ach/ptk/ppm/
PPM> rep add Theory http://theoryx5.uwinnipeg.ca/ppmpackages/
PPM> rep add Dada http://dada.perl.it/PPM
PPM> rep add Jenda http://jenda.krynicky.cz/perl
PPM> rep add rto http://rto.dk/packages/
PPM> rep add OpenInteract http://openinteract.sourceforge.net/ppmpackages/
PPM> rep add GA http://ppm.gingerall.cz
PPM> rep add EPN http://www.epn.ml.org/~spurkis/Agent/repository
PPM> rep add JMC http://homepage.eircom.net/~jmcnamara/perl

You can search what repositories you have via the command 'rep' as in:

PPM> rep

to get a list of the repositories you have listed, the active one will be marked with a leading '*'. Then type

PPM> rep set X

where X is the number of the repository you want to search.

PPM> help rep

will give you more commands.


PPM older versions:

Older versions of PPM use a different syntax to the current release.

Start your copy of PPM, either from the command line or via Start->Run and typing in PPM. You should then get a nice black command window (a la DOS), which you should enter the following:

PPM> set repository DevelopHelp http://ppd.develop-help.com/ppd/
PPM> set repository Roth http://www.roth.net/perl/packages/
PPM> set repository PTK http://www.xray.mpe.mpg.de/~ach/ptk/ppm/
PPM> set repository Theory http://theoryx5.uwinnipeg.ca/ppmpackages/
PPM> set repository Dada http://dada.perl.it/PPM
PPM> set repository Jenda http://jenda.krynicky.cz/perl
PPM> set repository rto http://rto.dk/packages/
PPM> set repository OpenInteract http://openinteract.sourceforge.net/ppmpackages/
PPM> set repository GA http://ppm.gingerall.cz
PPM> set repository EPN http://www.epn.ml.org/~spurkis/Agent/repository
PPM> set repository JMC http://homepage.eircom.net/~jmcnamara/perl
PPM> set save


Installing non-ActiveState modules:

You can now access a larger number of PPM packaged modules, including mod_perl [1]:

PPM> install mod_perl

and Template Toolkit:

PPM> install AppConfig
PPM> install Template-Toolkit

[1] Further information about installing mod_perl can be seen at:

http://perl.apache.org/docs/1.0/os/win32/install.html#PPM_Packages


Known Issues:

There are some issues with the latest version of PPM, which can be read at:

http://aspn.activestate.com/ASPN/PPM/


Browsing ActiveState's repository:

To search through ActiveState's repository to see whether the module you require has been uploaded into their repository, go to:

http://aspn.activestate.com/ASPN/Modules?module_name=C&order=name


Install Repositories from scripts

The first script, ppm-install1.pl, installs the PPM::Repositories module. You should also be able to do this via PPM itself (or cpan or cpanp).

CODE

#!/usr/bin/perl -w
use strict;

use PPM

PPM::InstallPackage("package" => 'PPM-Repositories');

The second script, ppm-install2.pl, reads through the current list of known PPM repositories, and adds those that are active and removes that are no longer used. I tend to use this whenever the PPM::Repositories module gets updated.

CODE

#!/usr/bin/perl -w
use strict;

use PPM;
use PPM::Repositories;

my @list = PPM::ListOfRepositories();
my %list = map {$_ => 1} @list;

for my $rep ( keys %Repositories ) {
    if($list{$rep}) {
        if(!$Repositories{$rep}->{Active}) {
            PPM::RemoveRepository(    "repository" => $rep,
                                    "save" => 1);
        }
    } else {
        if($Repositories{$rep}->{Active}) {
            PPM::AddRepository(        "repository" => $rep,
                                    "location" => $Repositories{$rep}->{location},
                                    "save" => 1);
        }
    }
}

You should now have all the active PPM repositories loaded. Happy installing.

Back to Perl FAQ Index
Back to Perl Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close