How to install Perl?
Installing Perl on Windows:
- To install Perl on windows, first download "ActivePerl" from www.activestate.com.
- Goto to the ActivePerl page, Click on Download button.
- Choose the version say ActivePerl 18.104.22.1680, 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 filename.pl inside root.
- If the Perl is not installed in the current path then use the command perl /usr/bin/perl filename.pl.
Executing the file using a browser:
This tutorial assumes that your server has Perl installed in it.