ActivePerl FAQ


NAME

ActivePerl-faq2 - Using PPM to install modules


DESCRIPTION

How to install and upgrade modules for ActivePerl using PPM


What is the Perl Package Manager (PPM)?

The Perl Package Manager (PPM) provides a command line interface for managing your Perl modules and extensions (packages). PPM allows you to access package repositories, install and remove packages from your system, and update packages you previously installed using PPM with the latest versions.


How do I install PPM?

PPM is installed when you install ActivePerl.


How do I run PPM?

Before you run PPM, you should be connected to the Internet. If your Internet connection is via a firewall or proxy, you should set the environment variable 'HTTP_proxy' to the name of this proxy server. If your proxy server requires a username and password, the environment variables 'HTTP_proxy_user' and 'HTTP_proxy_pass' should be set to these values. See PPM, Proxies and Firewalls for more information.

PPM can then be run by typing 'ppm' in a command prompt window.


How do I use PPM?

Quick start: at the PPM command prompt, type 'search' to get a listing of all available packages, then type 'install <packagename>', where <packagename> is the name of a package displayed by the 'search' command. To list the packages you have previously installed using PPM, use the 'query' command.

If you find the listing of packages scrolls by too quickly, you may want to use the command 'set more <number>' to pause the listing after <number> packages have been displayed. Use the 'set save' command to save this configuration for future PPM sessions.

By default, PPM will use the ActiveState package repository, but this too can be configured using the 'set' command. See below in Where are the package repositories?.

Below is a listing of key PPM commands (you can type 'help <command>' at the PPM prompt for usage details for a particular <command>). Items in [brackets] are optional.

Command Function
genconfig prints a minimal PPM configuration file to STDOUT [Note: genconfig only works from the command-line]
help [command] lists available commands, or help on 'command'.
info [package1...] prints a summary of installed packages.
install package1 [package2...] installs specified packages.
quit exits the program.
query [pattern] lists installed packages, or packages containing pattern.
query /abstract [pattern] lists descriptions of installed packages, or package descriptions containing pattern.
remove package1 [package2...] removes the specified packages from the system.
search [pattern] lists available packages, or packages containing pattern.
search /abstract [pattern] lists descriptions of available packages, or package descriptions containing pattern.
set set/display current options.
set save save current options.
verify [package1...] verifies currently installed packages are up to date.
verify /upgrade [package1...] installs available package upgrades.

A pattern is a search string just like the regular expressions - for example if you search for with this command

search ODBC|DBI

(which means 'search for packages in which the characters ODBC and/or the characters DBI are present in that order') you get a result like this

Apache-DBI
DBD-ODBC
DBI
FindBin
Win32-ODBC

Note that if you use 'search /abstract [pattern]' the search will only include the ABSTRACT section of the package files.


Where are the package repositories?

By default, PPM will use the ActiveState package repository, but there are other repositories on the Internet. At the moment there are these repositories:

http://www.ActiveState.com/packages The default package repository from ActiveState
http://Jenda.Krynicky.cz/perl Jan Krynicky's package repository
http://www.roth.net/perl/packages/ Roth Consulting's package repository
http://www.xray.mpe.mpg.de/~ach/ptk/ppm Achim Bohnet's package repository
http://rto.dk/packages/ RTO's packages repository (mostly mirrors of the above)

http://www.fastnetltd.ndirect.co.uk/Perl/zips/ Fastnet Software Ltd's packages - not directly accessible from PPM at present

To use these package repositories you start PPM and at the prompt type

set repository NAME URL

where NAME is a name by which you want to reference the repository from PPM and URL is the URL to the repository. You could for example type

set repository JENDA http://Jenda.Krynicky.cz/perl

The next time you do a 'search' you will not only search the ActiveState package repository but also the repositories you have added. Before you exit PPM you should save the changes to the configuration by issuing the command 'set save'.


How do I make a PPM package?

If you want to make a PPM package for use on other machine you can do it like this:

Specify the AUTHOR and ABSTRACT parameters in the Makefile.PL. However you should only pass them to WriteMakefile if the version of the perl is greater than 5.005 - older perls do not have these parameters added and do not expect to see them. This is an example Makefile.PL:

use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
    'NAME' => 'Term::Control',
    'VERSION_FROM' => 'Control.pm', # finds $VERSION
    ($] ge '5.005') ? (
        'AUTHOR' => 'Johnny Doel (johnny@doel.org)',
        'ABSTRACT' => 'Control the IO for terminals',
    ) : (),
);

Then you make the archive with the commands

perl Makefile.PL
nmake

The resulting files are placed in the blib directory that is created when you run nmake. These files should be packed into an archive like this:

tar cvf package.tar blib
gzip --best package.tar

You now have an archive called package.tar.gz. Then you generate the PPD file by:

nmake ppd

You have to edit the resulting PPD file and add the location of the package archive into <CODEBASE HREF="" />. The location is relative to the PPD file.

You can get nmake from ftp://ftp.microsoft.com/Softlib/MSLFILES/nmake15.exe. You can get tar and gzip from http://www.itribe.net/virtunix/.


PPM, Proxies and Firewalls

If you use a proxy server or firewall, you might have trouble running PPM. Here is the solution.

NOTE: If none of the changes in this document work for you, you may download individual packages from here and install them according to the directions in the README file contained within the ZIP file. If you want, you can also keep a local repository, with several .ppd files in a permanent repository directory, and their .tar.gz files in an x86 directory beneath that.

  1. Set Environment Vars

Up to three environment variables need to be set.

Under Windows NT
Right click on "My Computer", click on "properties", select the "environment" tab. These are your environment settings. Make the following changes:

  1. Add the setting HTTP_proxy, with your proxy name as the value (you must include "http://" ), followed by a colon and the proxy port, if applicable; e.g., "http://proxy:8080"
  2. If you require a user name and/or password to access your proxy, add the settings HTTP_proxy_user and HTTP_proxy_pass, with your user name and password as the respective values

Under Windows 95
In your AUTOEXEC.BAT file, place the following lines then reboot so the changes can take effect:

  1. SET HTTP_proxy=<your proxy server (you must include "http://" >, followed by a colon and the proxy port, if applicable; e.g., SET HTTP_proxy=http://proxy:8080
  2. SET HTTP_proxy_user=<your user name> (if required)
  3. SET HTTP_proxy_pass=<your password> (if required)

  1. Try using PPM

With your internet connection active, try using PPM again. Try to install a small package, like File-Slurp. You'll know that it still fails if you see an error stating that it can't find a ppd file for the specified package.

  1. Further Information and Help

If there were problems with any of the above hints, please see here on how to get further help.


AUTHOR AND COPYRIGHT

This FAQ was originally assembled and maintained by Evangelo Prodromou. It has been revised and updated by Brian Jepson of O'Reilly & Associates, David Grove, David Dmytryshyn, and Murray Nesbitt of ActiveState, Henning Michael Mler-Nielsen of RTO, Kevin Meltzer, and David Sparks of ActiveState.

This FAQ is in the public domain. If you use it, however, please ensure that you give credit to the original authors.

 ActivePerl FAQ