www. TLDnames.com
 register your domain name for only $19

Powered by 7ways

 

   

*Free* Features:

 

 

 
CGI/Perl Tutorials

This "tutorial" is not about using the properly syntax for CGI/Perl, but rather configuring your scripts to run on our server.



What is CGI/Perl?

Perl was originally designed to be a interpreter to help UNIX users with common tasks. However, with the explosive growth of the Internet it has been adapted to be a excellent interface to the web.

Perl has become the preferred programming language for making websites dynamic and user interactive. For example, you can use Perl to grab the data from your web page forms and perhaps write this data to a file (as in a guestbook) or send it to you via E-mail (as in a form).

Back to the top.



Links to places where you can learn CGI/Perl

The following is a list of sites we recommend for persons interested in learning the actual programming language of Perl. This tutorial does not get into the syntax, we only discuss configuring your scripts for use on our server.

Visit the following list of sites if you are interested in learning Perl:

Back to the top.


Links to free CGI/Perl archives!

Because of the enormous popularity surrounding Perl, many websites have become devoted to its growing success by offering free CGI/Perl scripts to visitors. The following list of websites offers quality CGI/Perl scripts that have been tested on our server. We have ranked the websites in descending order.


Back to the top.


Where Perl is on our server and where you can obtain the source code!

Perl is located in the following places on our server:
  • /usr/bin/perl5.003
  • /usr/bin/perl
  • /usr/local/bin/perl


You can obtain the original Perl sources code from the following website:


Back to the top.


Setting your permissions on your CGI scripts properly.

If you plan on running or linking to CGI script using the above method set your permissions accordingly: CGI FILE -- 700 or (Owner=execute/write/read, group=nothing, world=nothing)

DATA FILE that the script writes to but is not viewed on the web) -- 600 or (Owner=write/read, group=nothing, world=nothing)

DATA FILE that the script writes to and is viewed on the web (example: guestbook) -- 644 or (Owner=read/write, group=read, world=read)

The above permissions will insure MAXIMUM security.

Note: NEVER set your permissions on a file or directory to 777 as our server will not allow the script to execute because of the potential security hazard.


Back to the top.

Using the correct extensions for your CGI scripts.

If you are using a CGI script that you plan on being viewable by anyone (that creates output in the form of HTML), the it must have the .cgi file extension. If you try to do this with the .pl extension, it will not work.

The .pl extension will work in all other cases. However, we strongly suggest you use and only use the .cgi extension for your Perl scripts. This is a good habit and will factor out any problems relating to your scripts because of the file extension used.


Back to the top.

Configuring your variables so that your CGI scripts will run properly.

Variables are the part of the script you must configure so that the script knows where your files are and where data should be recorded. Absolute and URLs will most likely be used in the variables so you need to know what these are.

An absolute path is the path to a certain file or directory on the server. For example, the script might want to to set a variable ($links) to the absolute path to your links.cgi file. Below is what this should look like when configured properly.

$links="/home/your_login/public_html/cgi-local/links.cgi";

The script may also ask for the URL to this file (links.cgi). If the variable were $linksurl, we would set it as follows.

$linksurl="http://www.yourdomain.com/cgi-local/links.cgi";

CGI scripts obtained from free archives not made by you will almost always require you to set variables as we have done above. This is the most common source of problems with CGI scripts not working properly so make sure your variables are set correctly!


Back to the top.

Debugging your CGI scripts through Telnet.

One of the most powerful features of Telnet is that you can pinpoint problems in your CGI scripts. Unlike the HTTPD protocol which displays the infamous "Internal Server Error" message, telnet will tell you what is the real problem!

To test your script, you must execute it on the server which means your permissions must allow you (the user) to execute the script. Otherwise, a permission denied message will occur.

Telnet into the directory where the script you wish to test resides. Lets say that the CGI script named "links.cgi" is giving us problems! To find the problem, type in "./links.cgi". The server will then execute the script and tell you what, if any problems occur. The syntax for this command is "./script_name".

After you have found the problem, you can edit your CGI script using PICO in Telnet, then test it again. Eventually you will get your script working, and much faster than trying to pinpoint the problem yourself!

Note: 95% of the time, the problem is either the permissions on the script(s) are not properly set or the script(s) variable(s) are not properly set.


Back to the top.

Other useful links to CGI/Perl tutorials.

The following list of websites offer troubleshooting and tutorials on CGI/Perl:

Back to the top.
     

General

 
Webspace
Bandwidth
Control Panel
   

E_mail

 
POP3 Accounts
E-mail
Autoresponders
Forwarders
MajorDomo
List Manager
   

FTP/Telnet

 
FTP Accounts
Anonymous FTP
Telnet Access
   

Statistics

 
Log Files
Statistics
Counters
Site Reporter
Wusage
   

Authoring

 
Miva
ShockWave
mySQL
PHP
Python
Perl
CGI
SSI
Matt's Scripts
FrontPage 2000
   

Advanced

 
Sub-Domains
Control Panel
Java Chatroom
Real Networks
Password Control
Bulletin Board
Conference Chat
   

E_commerce

 
SSL Server
Hassan Shopping
 

 

 

 

| Home | Features | Order | Support |

  Make payments with PayPal - it's fast, free and secure!

1998-2007 Copyright Techtrade Internet Services