John Bokma Perl
freelance Perl programmer

Installing Perl on Windows

Step-by-step guide | 0 comments

For many years the Perl distribution I've been using as a freelance Perl programmer on Microsoft Windows has been the one made available for free by ActiveState: ActivePerl. This article explains how you can download and install Perl on your own computer running Microsoft Windows. ActivePerl is also available for several other operating systems, but I have no experience with running ActivePerl on those. And as the first line somewhat implied, there are other Perl distributions available for Windows. My choice of using ActivePerl is not based on a fair comparison - which distribution is the best for MS Windows - but what has been working for me and my customers for many years.

Downloading ActivePerl

You can download ActivePerl for free by navigating the ActiveState website or use the following shortcut for downloading ActivePerl. The latter shows first a form for optionally - as the page states - filling in your Contact Details. Just click on the blue Continue button underneath the form if you don't want to hand out those details or already have done so in the past.

Downloading ActivePerl for Windows (x86).
Downloading ActivePerl for Windows (x86).

The next page shows - at time of writing - two columns. The left column shows ActivePerl 5.8.8.820 download options for several operating systems. If you're using a non-64-bit version of Windows like me, download the MSI version under the Windows (x86) heading, see the above screenshot. Don't download the AS package unless you know what you're doing. If you hover the mouse over the yellow icon (help balloon) you can read some additional notes.

Intermezzo: Limit your user rights

In my experience quite some people work daily with Windows using an account with Administrator rights. Because they are not aware that they can limit those rights, or because they are aware of this, but consider logging in and out many times a day cumbersome.

I urgently recommend you, if you are currently working with Administrator rights most of the time to stop doing this if you're going to program. Whether you program in Perl or other language, one tiny mistake might delete not only your personal files but also files of people who might share the computer with you, or system files. The latter might result in your computer becoming unstable or no longer working at all.

If you're working with limited rights the damage is limited to your own personal files. So there is still a strong need for making backups often. I furthermore recommend to use a versioning system and will do my best to write in the near future an article on what this is and how you can benefit from it even if you work on your own, and even if you're just starting to program.

As for the limited user rights, you can create a new account via the Control Panel, and set the rights of the new account to Limited in the Pick an account type step.

If you're working with limited rights and you need more rights, you can either switch to an account with Administrator rights - in most cases you don't need to log out first - or you can use the Run As option either via a context menu or at the command line using the runas command. The latter offers as far as I know similar functionality as the sudo command found on other operating systems like GNU/Linux.

Installing ActivePerl

After the download of the ActivePerl MSI file (15.5MB) has finished it needs to be installed. Assuming that you are logged in with an account that has limited user rights (you did read the previous section?): press the Windows key and the L key at the same time to go to the Login screen (hint: you can memorize this combination as Windows Login). Select an account with Administrator rights in the Login screen and enter your password.

Tip: You can memorize the aforementioned key combination as Windows Login

Accepting the ActivePerl community license - installation step 2.
Accepting the ActivePerl community license - installation step 2.

Use the Explorer program to locate the folder the ActivePerl MSI file is located in and double click this file to start the installation program. A dialog Window is opened showing a welcome message. Press the Next button at the bottom of this dialog window to move on to step 2 and accept the ActivePerl community license.

Selecting ActivePerl features and installation location - installation step 3.
Selecting ActivePerl features and installation location - installation step 3.

Step 3 allows you to select which ActivePerl features will be installed, and the location of Perl. I recommend to leave everything as is and to click on the Next button at the bottom of the dialog Window.

Choosing setup options - installation step 4.
Choosing setup options - installation step 4.

The next step allows you to turn on or off several setup options. The first option: "Add Perl to the PATH environment variable", when enabled makes that typing perl on the command line starts the perl executable. The second option: Create Perl file extension association makes that entering just the name of a Perl program - which must have the pl extension - on the command line starts the Perl executable with the name of the Perl program as an argument. Or in short, this makes it possible to start your Perl program by just typing its name. Moreover, double clicking on your Perl program will also run your Perl program via the perl executable. I recommend to leave those two options in their default state: enabled.

The next five options are related with using Perl in web development in combination with IIS or another webserver. I have changed those options from their default enabled state to disabled as you can see in the above screenshot. You might prefer to leave them in their default state though.

After you have changed some options or left all in their default state and pressed the Next button at the bottom of the dialog window the Setup Wizard is ready to start the actual installtion process. Click on the Install button to start the installation of ActivePerl on your computer.

Some time later the Setup Wizard shows the final screen in the installation. If you don't want to read the release notes, click on the checkbox to disable this option. Click on the Finish button to close the Setup Wizard.

Testing the ActivePerl installation

For a real test of your ActivePerl installation you need to run several Perl programs. However, a simple test to see if the perl excutable has been added to your PATH environment variable and actually is able to run is to enter perl -v at the command line.

Press the Windows key and the R key simultaneously to open the Run dialog window. Enter cmd into the input area and press Enter. A command prompt - also known as DOS box - is opened. Type perl -v and press enter to obtain information on the current perl program.

Tip: You can memorize the aforementioned key combination as Windows Run

The following text or one that is similar will show up int the command prompt window:

C:\Documents and Settings\John>perl -v

This is perl, v5.8.8 built for MSWin32-x86-multi-thread
(with 50 registered patches, see perl -V for more detail)

Copyright 1987-2006, Larry Wall

Binary build 820 [274739] provided by ActiveState http://www.ActiveState.com
Built Jan 23 2007 15:57:46

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

If you ever want to report a problem with Perl or need help be sure to include the entire first line reported by perl and the build number.

Perl Documentation

ActivePerl comes with a lot of documentation which can be accessed in two ways and I recommend to familiarize yourself with both.

perldoc

todo

Where to go from here

todo

Perl related

Please post a comment | read 0 comments | RSS feed