Isle of Man's Premier Internet Service Provider
'Free Internet Service Provider serving the Isle of Man and the UK'


Webspace Menu
Webspace Help 
FAQ
Email Support
How to FTP
Hints and Tips
Meta Tag Help
Installing a Counter
Response Forms
Software Downloads

Perl Starter Guide
PHP Starter Guide
Contact Frequently Asked Questions About Help Files Sign-Up Online Search Portal
 Perl Starter Guide

JavaScripts are simple. You just FTP them to your web site and you're done. But setting up a Perl script is a bit more involved process for the novice. This page will hopefully show you how to set up a Perl script on your server.


1. CGI Permissions
Of course, the first thing you need is CGI permissions. Many services will give you web space but not CGI permissions. Sometimes you just need to ask your system administrator, but with some services, they just do not allow users to have CGI permissions. And having CGI permissions doesn't necessarily mean that you have access to the cgi-bin directory. On most servers, .cgi files can be run from your home directory as long as they are set up correctly (and as long as you have CGI permissions). IofM.net webspace users should make sure that their scripts end with .cgi when using perl scripts on the servers.


2. Path to Perl
The second thing you need to do when you get a Perl script is put your path to Perl on the top line. The first line of every Perl script needs to look something like this:

#!/usr/bin/perl

Also, check the top of the script for things that you might need to modify. For instance, some services do not allow you to put your log files in the same directory as your CGI scripts. If the script involves log files, there is probably a comment near the top telling you where to type in the path to your log files. Just be sure to read all the comments near the top of the script.


3. FTP
Once you have put your path to Perl on the first line of the script and made any other specified modifications, you then need to FTP the file(s) to your web space. If you don't have FTP software, try Fetch for Macintosh, or WS-FTP for Windows. Then, FTP your files to the directory containing your other HTML files. Remember that these files will be viewed through a browser, so put them somewhere that you can open them with a URL.

This is IMPORTANT. You must upload the Perl scripts as TEXT NOT BINARY. Here's a general rule of thumb: If you edit something in you text editor, upload it as TEXT.


4. Debugging and running it
After you have the permissions set, jump over to your browser and try to run the script. Just enter the URL of the location where you put the script. Now of course, Murphy's Law tells us that there will inevitably be some sort of internal server error (usually error 500). Don't freak out. That just means that something (hopefully something minor) is wrong with how the script is set up. From this point, you're on your own. Just try to fix the compliation errors and you should be set.



Perl Links:

The site for people learning Perl - http://learn.perl.org/
Perl Mongers - http://www.perl.org/
Perl Mailing Lists - http://lists.perl.org/


Terms and Conditions Copyright © IofM.net