Perl and E-Commerce Web Servers
In a Nutshell - CIW Course Section 3, Part B2, Chapter 2
Perl Overview
Perl is a commonly used language for the development of CGI scripts as it is considered easier to use than C-structured languages and is especially designed for processing text.
Perl is supported on a number of platforms including Microsoft Windows 2000, Microsoft Windows NT, Linux, Solaris,and HP-UX. Developers like Perl as it's interpreted nature makes it very portable cross platform.
Installing Perl in IIS
The course documents the installation process for ActiveState's ActivePerl, and this does appear to be one of the better interpreter packages. The installation of ActivePerl is simplicity itself, the MSI version is better for Windows 2000. Start the install follow the Wizard, accept all the default options and click "Finish". Then put the kettle on, as it takes a little while to install.
A word of WARNING: When you download ActivePerl, be sure to save it to a local hard disk on the machine on which you intend to install it. It will not install from a mapped drive or share. This had me flummoxed for quite a while.
Perl automatically associates .pl extensions with the Perl.exe application, so all that remains to be done, to get it working, is to set the appropriate permissions on the Home Directory.
Enabling Scripts in IIS
Select the "Properties" of the default web site and click the "Home Directory" tab. From here you want to set the "Execute Permissions".
Select "Scripts and Executables" from the "Execute Permissions" drop-down list, to allow any script or program file to be run.
CGI Scripts on Apache Server
To install scripts you will, logged in as root, copy the script files to the /var/www/cgi-bin/ directory. Make this directory the current directory using the cd command. You may use the cat command to view the script. The scripts need to be executable by the Apache server account so, you use the chown command to set the owner and group for the files.
Troubleshooting Perl Installations
The first step will be to ensure that Perl is correctly installed on the server. The three replies from the command rpm -qa | prep perl will confirm that Perl is installed. Next, ensure that the shebang line in the scripts specifies the correct location for the Perl interpreter. The default location for the Perl interpreter is /usr/bin/perl on most Linux systems, but this may vary.

