Quality web hosting and ecommerce solutions web hosting,webhosting,unlimited web site hosting,web hosting services,cheap web hosting,reseller web hosting,domain host,best web hosting, business hosting, Ecommerce web hosting,best web host,webhosting
Online Ecommerce and business solutions
Providing high quality web hosting and ecommerce solutions for businesses and individuals around the world.
Magicz Web Hosting



Webhosting



Ecommerce








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

What is CGI/Perl?
Links to places where you can learn CGI/Perl.
Links to free CGI/Perl archives!
Where Perl is on our server and where you can obtain the souce code!
Using the correct extensions for your CGI scripts.
Configuring your varibles so that your CGI scripts will run properly.
Debugging your CGI scripts through Telnet.
Other useful links to CGI/Perl tutorials.





What is CGI/Perl?


Perl was originally designed to be a enterpretuer to help UNIX users with commen tasks. However, with the growth of the Internet it has been used as an excellent interface to the web. Perl has become the preferred programing language for making websites dynamic and user interactive. For example, you can use Perl to grab the data from your webpage 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). We will discuss some of the basic principles to running PERL.
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 acutal 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:

http://www.ora.com/info/cgi/intro.html
http://208.16.5.2/~myrkatz/journal/cgitutor/
http://www.web-consult.com/web/perl.html
http://www.extropia.com/Scripts/Book/Mis/appendix_a.html
http://lightsphere.com/dev/class/
Back to the top.




Links to free CGI/Perl archives!


Because of the enormous popularity surrounding Perl, many websites have becomed 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.

Hotscripts
CGI-resources.com
Matt's Script Archive
Back to the top.




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


Perl is located in the following place on our server:
/usr/bin/perl
You can obtain the origianl Perl souce code from the following website:
http://www.perl.com/
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 varibles so that your CGI scripts will run properly.


Varibles 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 paths 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 set a varible ($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-bin/links.cgi";
The script may also ask for the URL to this file (links.cgi). If the varible were $linksurl, we would set it as follows.
$linksurl="http://www.yourdomain.com/cgi-bin/links.cgi";
CGI scripts obtained from free archives not made by you will almost always require you to set varibles as we have done above. This is the most common source of problems with CGI scirpts not working properly so make sure your varibles 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 the real problem is!
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 scripts(s) varible(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:

http://www.tardis.ed.ac.uk/~angus/Computing/ Programming/Perl/Notes/CGIDebugging.html
http://www.boutell.com/faq/
Back to the top.
Copyright © 1998-2009 Magicz.com. All Rights Reserved. Please see our Acceptable Use Policy and our Privacy Policy.
PHP web Development by Virvo
web hosting, webhosting, web site hosting, ecommerce, web hosting services, cheap web hosting, reseller web hosting, domain host, ecommerce host, web page hosting, best web hosting, business hosting, Ecommerce web hosting, cheap webhosting, web hosting services, cheap web site hosting, affordable web hosting, business web hosting, best web hosting, small business web hosting