Installing Perl on Windows

30 November -0001
Justin C. Klein Keane
January 11, 2007

First download Active Perl from the ActiveState site. It is important to note that several windows versions are available for different processor architecture. Be sure to download the correct version (or try alternate versions until one works if you're not familiar with your processor type). If the MSI installer doesn't work for you try downloading the zipped AS package. You'll need a utility such as Winzip or 7-zip to decompress it. You'll have to set up your own environmental variables if you try this method, and the program won't install actually, you'll have to run the binary out of whatever directory you decompress the package into.

You'll want to use the installer because it will properly register all the parts of Active Perl and it will even update your environmental variables. Environmental variables will allow you to execute perl from anywhere on your hard drive without having to locate the program binaries first. For instance, if perl installs in C:\Perl you'll be able to execute perl code directly from C:\. To view your environmental variables right click the 'My Computer' icon on your desktop, click 'Properties', select the 'Advanced' tab and click the 'Environmental Variables' button. The environmental variable needed for Perl is the PATH user variable. If you select this from the list and click the 'Edit' button you can add new paths (separated with a semi-colon) to the list.

Screenshot showing environmental variables settings

Once perl is installed check to see that it is working correctly. Open a command prompt (Start->Run->cmd) and type in

perl -v

You should see the version information associated with your installation.

Using PPM to add packages from CPAN, the perl repository. PPM now comes with a nifty GUI program that allows you to select programs from a list. If you type

ppm

at the command line the GUI should pop up on your desktop.

Screenshot of the PPM GUI

Once you select packages you wish to install click the 'run marked actions' button to complete the installation. Note, however, that some packages (such as DBD-Oracle) still have to be installed at the command line, so you'll need to type in commands at the prompt.

Last install an IDE, I recommend the Open Source PerlIDE. There is no need to compile or install this program, simply download the binary from SourceForge, unzip it and double click the program icon to run it.

Screenshot of PerlIDE.

Once you've gotten everything set up you're ready to try out some code. Try writing up a quick script in PerlIDE and press the F9 key. This will run your code and should print out any output to the 'Console' tab at the bottom of PerlIDE.