Lesson 4 | Installing Perl on your Windows system |
Objective | Configure your system for perl and then install it. |
Installing Perl on your Windows System
Unix Installation Instructions for Perl
Installing Perl on your system is a relatively straightforward process if nothing goes wrong. If something does go wrong, you will need to be very familiar with Unix and your particular system setup to figure out what the problem is. If you are not confident in your ability to debug your system, I suggest that you get an experienced system administrator to accompany you as you install Perl.
- Step 1: Become Superuser on your system
On most Unix systems you must type the following command and then provide the appropriate password:
$ su -
If you do not have superuser access to your system, your system administrator will have to install Perl for you.
- Step 2: Unpack the Perl distribution
First, use the cd
command to get to the directory where you keep source code on your system:
$ cd /usr/src
Then, use the tar
command to decompress the source code:
$ gunzip < latest.tar.gz | tar -x
There will now be a directory called /usr/src/perl5.003
. To continue, use the cd
command to get into that directory:
$ cd perl5.003
- Step 3: Configure Perl
Perl comes with a special shell script that is used to configure Perl for your system. Before you run the Configure script,
I highly recommended that you read the 1) readme.txt and 2) install.txt files.
They will give you much more detailed instructions than I can provide here. Next, type the following to run the Configure script:
$ sh Configure
You will see a lot of messages as Configure examines your system and configures the "make" script. You will be asked questions about how your system works, and some of the questions may require research to answer. When in doubt, it is often sufficient to accept the default answer. But by doing so,
you run the risk of having Perl fail and having to run Configure again.
-d switch (sh Configure -d)
On most systems, using the -d
switch (sh Configure -d
) will use all of the defaults without asking you.
Actually, there is one place where you will still need to press Return: at the
1) Press return or 2) use a shell escape to edit config.sh: prompt. Although the -d
switch is convenient, it also removes a level of control and you run the risk of your perl install failing.
- Step 4: Compile Perl
Now you can compile Perl. To do so, simply type this command:
$ make
You will get a lot of messages from the compiler, most of which you can ignore. If the script ends with an error, it will tell you.
- Step 5: Validate your installation:
Now you can run a regression test on your Perl installation:
$ make test
You will see a lot of tests being executed. Unless there was a problem with your installation, you should eventually see the message:
All tests successful.
- Step 6:
Now you can install the Perl program in its proper directory by running this command:
$ make install
This will put Perl in /usr/local/bin
and a symbolic link in /usr/bin
.
When this is all completed, you are ready to write and run your first Perl script.
Perl installation on Mac OS X
Once you have downloaded and saved to your desktop the
MacPerl port for the Macintosh, installation is simple.
- Step 1 - Unzip the download
Unzip the downloaded file with StuffIt Expander or a similar decompression utility.
- Step 2 - Run the installer
Double-click the installer. This will prompt you to select the installation package appropriate for your Macintosh system. Then, select a destination folder for the application and associated files, and click Install.
- Step 3 - Read the documentation
MacPerl should now be installed on your system. Take some time to read over the readme file and while you are at now is the time to closely examine all of the benefits associated with visiting the MACMALL.
The next two lessons will start your journey into learning what Perl actually is and why it's such a popular language with Unix system administrators.
- Win32