How to Install Perl
on your Operating System



You must install Perl on your computer in order to run a Perl script. But before going into the hassle to install it, you need to check up if Perl is already installed on your computer. If your operating system is Unix or Linux, there is a big chance that Perl is already installed. In this case, all you have to do is to skip this section.

To see if you have Perl installed on your computer you need to get to a command prompt. To get this, it depends on your operating system.

If you have Unix or Linux, simple log in and you’ll have access to the command prompt. If you have a graphical interface instead, after the log in you need to open a terminal window in order to have access to the command prompt.


On a Windows system, click Start-->Run and in the Open field type cmd and than confirm by clicking the OK button. It will open a cmd window where you can type the commands you want to be executed. At the command prompt, please type the following:

perl -v

and you’ll receive either the message "command not found" which means perhaps you must install Perl, or Perl’s version number.


Install Perl on Linux

First, you need a copy of Perl source bundle and you can download a stable version from the site "http://www.perl.com". At the moment I am writing these words, I found available the archive perl-5.8.8.tar.gz. You also need an ANSI C compiler, but don’t worry about this, Perl’s configuration program will check for one. If it will not find it, you can install a prebuilt version or install the C compiler supplied by your OS vendor, or for a free C compiler try "http://gcc.gnu.org/".

Now, get a command prompt and enter the following commands:

gunzip perl-5.8.8.tar.gz
tar xf perl-5.8.8.tar

and wait the end of decompression. If you don’t have the gunzip decompression program, you can download gzip bundle from http://www.gnu.org.

The next step is to launch the configure program of the Perl bundle. The installation shell script will examine your system and ask you questions to determine how perl5 package should be installed. If you want to bypass all the questions and use the computed defaults or the previous answers if there was already a config.sh file, you can run "Configure –d":

cd perl-5.8.8
sh Configure –d

After the Perl configuration step, you must build Perl by typing in the following command:

make

After this step, you can verify Perl’s installation, running again the following command at the command prompt:

perl –v

Install Perl on Windows

The best idea for installing Perl under Windows is to use ActivePerl – the worldwide standard for Perl on Windows. The free ActivePerl binary distribution includes core Perl, popular modules, the Perl Package Manager (PPM), and complete documentation.

You can download it from "http://www.activestate.com" and install it on your computer – the distribution is self-installing and the installation process is just the same as the one you used for other similar windows applications.


Table of Contents:

A Perl Script
Running Perl
Perl Data Types
Perl Variables
Perl Operators
Perl Lists
Perl Arrays
    Array Size
    Array Length
Perl Hashes
Perl Statements
    Perl if
    Perl unless
    Perl switch
    Perl while
    Perl do-while
    Perl until
    Perl do-until
    Perl for
    Perl foreach
Built-in Perl Functions
    Functions by Category
        String Functions
        Regular Expressions and Pattern Matching
        List Functions
        Array Functions
        Hash Functions
        Miscellaneous Functions
    Functions in alphabetical order
        chomp
        chop
        chr
        crypt
        defined
        delete
        each
        exists
        grep
        hex
        index
        join
        keys
        lc
        lcfirst
        length
        map
        oct
        ord
        pack
        pop
        push
        q
        qq
        qw
        reverse
        rindex
        scalar
        shift
        sort
        splice
        split
        sprintf
        substr
        tr
        uc
        ucfirst
        undef
        unpack
        unshift
        values

return from Install Perl to Perl Basics



Would you like to create your own website like this one?
Hit the Alarm Clock!

Site Build It!