Perl Programming   «Prev 

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 readme.txt and 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 Press return or 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: Finally...

Now you can install the perl program in its proper directory by running this command:
$ make install