Installing Perl

How to install Perl?


Installing Perl on Windows:

  • To install Perl on windows, first download "ActivePerl" from
  • Goto to the ActivePerl page, Click on Download button.
  • Choose the version say ActivePerl, click on the MSI link under the Windows(x86).
  • Double click on the installer and follow the instruction, click next to finish the installation.

Configuring Perl with Apache:

  • Open the httpd configuration file from C:Program FilesApache GroupApacheconfhttpd.conf.
  • Depending on the system one has to change the path in this file, say like c:programfilesapacheconf
  • Search for "AddModule mod_cgi.c" and remove the # before that line.
  • Search for "AddType application/x-tar .tgz" and in the next line add "Addtype cgi-script .cgi .pl".
  • Restart Apache if it is already running. And now apache is ready to parse and execute .cgi and .pl scripts.

Now you are ready to use Perl with Apache server.

Installing Perl on Linux:

  • By default Perl will be installed in Linux.
  • To know the location where perl is installed in your linux machine, execute the command "whereis perl", it gives the path /usr/bin.
  • To execute a file from command prompt, use perl inside root.
  • If the Perl is not installed in the current path then use the command perl /usr/bin/perl

Executing the file using a browser:

  • To check all the working directories, type "ls" from root.
  • Check if the module is present in path etc/httpd/modules.
  • Check for conf.d is present inside etc/httpd/conf.d.
  • Goto cd/conf.d. then type in vim perl.conf
  • Check for the module Loadmodule Perlmodule modules/, uncomment if it is commented.
  • If AddHandler cgi-script .cgi .pl is commented, uncomment it.
  • In the directory /var/www/html user has to add "ExecCGI" to the following lines.
  • Options Indexes FollowSymLinks ExecCGI
    SetHandler cgi-script
  • Just execute your Perl file from the browser like localhost/


This tutorial assumes that your server has Perl installed in it.

Ask Questions

Ask Question