Search:   


General CGI-Perl FAQ

  1. What is CGI?
  2. What is Perl and why do so many people use it for CGI?
  3. What is the structure of a CGI Script?
  4. What do I do if my script doesn't run?
Unix
  1. Am I allowed to run user-written CGI programs?
  2. Is approval for my scripts neccesary?
  3. What version of Perl do you support?
  4. What is the script comment line to make a Perl script file execute?
  5. What are the require filename extensions for CGI programs?
  6. Are my scripts require to reside in a special directory?
  7. Can I create a cgi-bin directory?
  8. What is the absolute path to my root directory?
  9. Which Perl modules are installed in the default Perl library path?
  10. What is the path for the sendmail command?
  11. How do I change permissions on files?
  12. How do I fix an 'Internal Server Error'?
  13. Can I use a formmail.pl script?
Windows
  1. What version of Perl do you support?
  2. How do I setup formmail?
  3. What is the absolute path to my root directory?

1. What is CGI?
CGI is a protocol that can be used to communicate between Web forms and your program. Typical applications include accessing a database, submitting an order, or posting messages to a bulletin board.

2. What is Perl and why do so many people use it for CGI?
Most CGI applications involve manipulating data in some fashion and accessing external programs and applications. Perl provides easy to use tools that make these tasks a cinch.
Perl is an interpreted language optimized for scanning arbitrary text files, extracting information from those text files, and printing reports based on that information.

3. What is the structure of a CGI Script?
Here's the typical sequence of steps for a CGI script:

  1. Read the user's form input.
  2. Do what you want with the data.
  3. Write the HTML response to STDOUT.

4. What do I do if my script doesn't run:

  1. Make sure the path to perl is correct, in the first line of the script.
  2. Of course, make sure your HTML file calls the correct URL of the script, either relative or absolute.
  3. For clues, run the script from the command line and see how it fails. This doesn't always get far, because the CGI environment variables aren't set correctly. Get farther by tweaking a test copy of your source code.

Unix

1. Am I allowed to run user-written CGI programs?
Yes. Cgi-scripting is allowed. The programs can be run from at directory as long as you set the correct permision on them
755 is the most common permission setting.

2. Is approval for my scripts neccesary?
No. Approval is not needed for your CGI scripts.

3. What version of Perl do you support?
We support Perl 5.

4. What is the script comment line to make a Perl script file execute?
The location of Perl is /usr/bin/perl

5. What are the required filename extensions for CGI programs?
Any normal script extension should work fine (.cgi or .pl).

6. Are my scripts required to reside in a special directory?
No.

7. Can I create a cgi-bin directory?
Yes. Just make sure the correct permissions are set on the file and directory that it is in. This is normally 755

8. What is the absolute path to my root directory?
You should use the relative path or build the absolute path like this
$ENV{DOCUMENT_ROOT} . '/relative/path/to/file.txt';

9. Which Perl modules are installed in the default Perl library path?
The standard Perl 5 tools are installed at the path /usr/bin/perl

10. What is the path for the sendmail command?
Mail to should be directed to /usr/sbin/sendmail.

11. How do I set permissions on files?
You can change the permissions on your files by using any FTP client that supports the "SITE" or "chmod" commands. Two websites that may be of help are:
How do I change permissions on a file? - University of Pennsylvania
Using chmod - UNIX User's Guide

12. How do I fix an 'Internal Server Error'?
RCN does not support your scripts only that perl runs correctly. RCN can only offer suggestion as to how you can correct the issue. An 'Internal Server Error' indicates that one or more of the following is true.

  1. If the script does not contain the "#!/usr/bin/perl" header line that points to the Perl interpreter, or if the path to the interpreter (and/or a library file) is invalid.
  2. If the first line output from the script is not a valid HTTP header (i.e "Content-type: text/html"), or if there is NO blank line after the header data.
  3. If there is a syntax error in your script. Always run it from the command-line first.

13. Can I use a formmail.pl script
Yes. You can obtain formmail.pl scripts at
Matt's Script Archive: FormMail or
nms FormMail or
You may also create your own from scratch

Windows

1. What version of Perl do you support?
We support the latest build of ActiveState Perl for Win32. More information can be found in ActiveState's documentation.
Note: You do not need to specify the path to PERL in your script. Just be sure the script you want executed has an extension of either ".pl" or ".cgi".

2. How do I setup formmail?
For Perl: You can use the Mail::Sendmail perl module.
For ASP: You can use AspMail 4.x
For PHP: You can use PHP Formmail You will need to set '$PEAR_SMTP_HOST' to 'smtp.rcn.com'

3. What is the absolute path to my root directory?
Please use the relative path, as the absolute path may change without notice


RCN Support Numbers  Support Numbers

Toll Free:
 1.877.726.7000


Email Support  Email Support

commercial.service@rcn.com

RCN Other
 Other Pages

Domain Registration Pricing »
Compare Unix Packages »




© 2013 RCN Telecom Services, LLC. All Rights Reserved