In most of the cases, you have it already installed on your System as several Operating systems have it pre-installed. To check whether you have it on your system, you can go to command prompt (terminal in mac) and type “perl -v” without quotes. If you have it on your system then you should see a message like this:
This is perl 5, version 18, subversion 2 (v5.18.2) built for darwin-thread-multi-2level (with 2 registered patches, see perl -V for more detail) Copyright 1987-2013, Larry Wall 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.
However if you don’t get this message, you can install the perl for free. The steps are as follows:
Installing Perl on Windows
There are two methods (more specifically two distributions) to install Perl on Windows. One is using ActivePerl another is StrawberryPerl, you can choose either one of them. However if you are more concerned about which one you should choose, you can refer this discussion:
To install Active Perl: go to this link: http://www.activestate.com/activeperl and download the installation file, installation steps are self explanatory.
To install Strawberry Perl: go to this link: http://strawberryperl.com/ and download the 32 bit or 64 bit version depending on your system. Install the downloaded file.
Installing Perl on Linux/Unix
Go to this link: https://www.perl.org/get.html click on Linux/Unix tab. You should see something like “Download latest stable source (5.24.1)”, click on it and download the zipped file, at the time of writing this article 5.24.1 is the latest stable version, you may find it different, don’t worry just download the file. Save it in your home directory, which should be your current working directory, install the perl with the following shell commands:
tar -xzf perl-5.24.1.tar.gz cd perl-5.24.1 $./Configure -de $make $make test $make install
Note: You may need to change the version in the above shell commands according to the source file you have downloaded, for e.g. if you have downloaded the version 5.10.1 then the set of commands would be:
tar -xzf perl-5.10.1.tar.gz cd perl-5.10.1 ./Configure -de make make test make install
Installing Perl on Mac OS
Installing perl on Mac is similar to Linux/Unix, go to the same link https://www.perl.org/get.html and click on Mac OS X tab. Download the source file (click on Download latest stable source) and run the following commands in the terminal.
First change the directory in terminal where in you have downloaded the zipped file. for e.g. if you have downloaded the file in Downloads directory then change the directory by typing this command:
Once you are in the directory where you have the zipped file, run the following commands:
tar -xzf perl-5.24.1.tar.gz cd perl-5.24.1 ./Configure -de make make test make install
Remember to change the version in the above commands according to the version you have downloaded. For e.g. if you have downloaded perl 5.10.1 then change 5.24.1 to 5.10.1 in the above commands.