Perl Topics





Español Français 中文 Deutsch Portuguese Japanese nederlands
   
 
Perl Tutorial
Introduction Introduction
Installing Perl Installing Perl
Basics of Perl Basics of Perl
Scalar Variables Scalar Variables
Operators Operators
Control Structures Control Structures
Lists Lists
Array Array
Arrays Manipulation Arrays Manipulation
Arrays Functons Array Functions
Hash Hash
Hash Functions Hash Functions
String Functions String Functions
Regular Expression Regular Expression
Regular Expression Functions Regular Expression Functions
Numerical Functions Numerical Functions
List Functions List Functions
User Defined Function User Defined Function
File Handling File Handling
Forums Ask Your Doubts
Feedback Feedback
 






outsourced web hosting support

Installing Perl


Tutorials Perl

Topic
How to install Perl?



Explanation
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 5.8.8.820, 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 Files\Apache Group\Apache\conf\httpd.conf.
  • Depending on the system one has to change the path in this file, say like c:\programfiles\apache\conf\
  • 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:
  • To check all the working directories, type "ls" from root.
  • Check if the module mod-perl.so 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/mod_perl.so, 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/filename.pl.

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






A Note
Simple introduction, basic CGI perl programming codes with examples. Do send your feedback or suggestions on this tutorial. This is a copyright content.

Other Links

web hosting