Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I install modules on Win32 machines?

Installing Modules

How do I install modules on Win32 machines?

by  missbarbell  Posted    (Edited  )
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
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.

Using CPAN or CPANPLUS

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:

cpan>

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 :)

Barbie.
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top