Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • 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!

*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.

Students Click Here

Installing Modules

How do I install modules on Win32 machines? by missbarbell
Posted: 25 Mar 02 (Edited 24 Apr 03)

Modules or Packages are bundles of code that are available for free use from either CPAN or ActiveState, which contain many helpful and useful functions.

Using PPM

If you have installed ActivePerl, you will also have installed ActiveState's very own Perl Package Manager (or PPM for short). This provides a handy way of getting at the modules/packages from ActiveState's code repository.

From the command prompt window (click the windows Start button and then 'Run...') type 'ppm'. This will then launch the ppm in a dos prompt window. From there you have several commands available to you, type help to see a list.

To install a package type 'install myPackage', where myPackage is the name of the package you require, eg to install the package HTML-Parser you would type 'install HTML-Parser'.

If you have a problem, especially if you have a firewall or proxy setup or are running on NT, check the ActiveState FAQ at http://aspn.activestate.com/ASPN/Products/ActivePerl-5.6/faq/ActivePerl-faq2.html for specific details of how to set up PPM.

The full list of packages can be found at http://www.activestate.com/PPMPackages/zips/6xx-builds-only/?_x=1 .

Using nmake

So what happens if the package you require isn't there? Well as always with Perl, there is more than one way to do it.

If the package you want isn't available as an ActiveState package, you can download the .tar.gz version that is stored on CPAN (http://search.cpan.org). Unzip and untar the contents to a temporary directory.

Next download nmake (unless you already have a copy) from Microsoft at http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe and save it in you system32 directory under the windows directory.

Open another command prompt window by typing 'command', and change directory to the temporary directory where you saved your package. Type the following commands ensuring there are no errors:

perl Makefile.pl
nmake test
nmake install

If you do encounter any errors, first check any Readme or similar file that came with the package, for any known problems. If you are still having problems you may be able to contact the author of the package. Failing that there maybe someone on tek-tips who can help you.


To make life even easier there are two packages available on CPAN, that can download and install packages automatically. CPAN.pm is the original package, with CPANPLUS.pm being a rewrite with more features. Take a look are their entries in CPAN for more details, here I will just describe the basics to get you started.

We'll assume you have installed CPAN.pm for this example. To activate it, first open a DOS command line window, then enter the following command:

$> perl -MCPAN -e shell;

The -M tells the Perl intepreter to use the module CPAN. The -e executes the command as if it was part of a script. The shell is a wrapper that handles all the IO to and from the keyboard/screen.

If this is the first time you have used the module you will be asked to configure the CPAN installer. You can accept all the defaults and the installer will search for all the appropriate programs in their usual places. If you get stuck check the module's perldoc.

Once everything is configured you see the following prompt:


From here you can do much the same kind of commands as in PPM. The difference being that this uses CPAN itself rather than a propriety version such as Active State's repository.

To install a module simply type:

cpan> install Package::Module

The added benefit of CPAN.pm and CPANPLUS.pm is that they both understand prerequisites. This means that if you wish to install a module that uses another module that you don't already have installed, it will ask you whether you want to install that as well.

They both automatically test modules before installing them too, so if and module does fail, no damage is done to your system.

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