Installing Perl Modules From CPAN
For Windows Servers Where You Own or Control the Whole Server
(For other situations, see the Perl Modules main page.)
If you're using ActivePerl in order to run Perl scripts on your Windows server, you can use its included "ppm" command to install or upgrade Perl modules. But you may find that the versions available via ppm aren't quite up to date, and CPAN has newer versions.
But you can still install those newer versions into your ActivePerl installation. Just download and unzip the "ModuleName.tar.gz" file from CPAN. At this point, you may be able to get away with simply copying any *.pm files from here into your C:\Perl\lib\ directory (keeping subdirectories intact). But if that doesn't work, the proper/official way to proceed is to open a command prompt and switch to the directory where you unzipped the module, and run "perl Makefile.pl" there. Then run "nmake" followed by "nmake test" and finally "nmake install". (You can get nmake from Microsoft if you don't already have it; just download the file and unzip it into your C:\Windows\ directory.)
For example, to upgrade your CGI module:
- Open a command prompt (click Start, then Run, then type either
cmd
orcommand
, press Enter) and type this to see what version of CGI.pm you currently have:perl -e "use CGI; print $CGI::VERSION";
- Create a directory called C:\temp\ if you don't already have one.
- Download CGI.pm-3.25.tar.gz into your C:\temp\ directory, then unzip it; this should create the directory C:\temp\CGI.pm-3.25\.
- Open a command prompt (or use the same one from before) and type:
C:
cd \temp\CGI.pm-3.25\
perl Makefile.pl
nmake
nmake test
nmake install
- Repeat step #1 to check your CGI version and it should now be the new version.