Perl : Frequently Asked Questions
System/Setup Questions
- Can I run CGI scripts?
- Do I get my own CGI-BIN?
- What version of Perl are you running?
- What is the path to the Perl?
- Do you have 'X' Perl module installed?
- Can I run Perl scripts that have the .pl file extension?
- Do you have mod_perl installed?
Running Perl/CGI Scripts
- Can I do 'X' with Perl?
- I keep getting 'Internal Server Error' when I run my script!
- How can I see errors in the browser window?
- Do you guys have a script to do 'X'?
System Setup Questions
Can I run CGI scripts?
Of course you can! You can run Perl/CGI scripts from anywhere in your web root directory (www/public_html for free accounts, www/youdomain.com_html for paid accounts).
Do I get my own CGI-BIN?
Yes and No. Since you can run Perl scripts from anywhere in your web root directory, you really don't need to have one. If you would like to have one, simply create a cgi-bin/ directory in your web root and place all of your Perl scripts in there.
What version of Perl are you running?
We are currently running Perl 5.8.1.
What is the path to Perl?
The path to the Perl binary is /usr/bin/perl.
Do you have 'X' Perl module installed?
We install the default modules that come with a standard installation of Perl. A list of the currently installed modules is generated on a nightly basis. The list can be found here.
If you have a special Perl module you would like installed and feel that it would benefit the community as a whole, Contact Us and plead your case.
You can also build the modules on your own machine and FTP them out into the directory of the application using them. More information on building Perl modules can be found at http://www.cpan.org/modules/index.html.
Can I run Perl scripts that have the .pl file extension?
Yes you can. All files ending in .pl and .cgi are recognized as CGI scripts.
Do you have mod_perl installed?
No, we don't. Sorry.
Running Perl/CGI Scripts
Can I do 'X' with Perl?
Yes! You can do pretty much everything imaginable with Perl. To learn more about perl and its million and one uses, visit:
I keep getting "Internal Server Error" when running my script!
Not to worry! This is usually caused by an error within your Perl script. There are many common errors that cause this. Here is a checklist to follow to ensure your script will run properly.
- Be sure to upload your scripts with your FTP client in text mode. UNIX uses LF (linefeeds) to separate lines. If you are using DOS it is important the the CR LF to LF translation be done. If you are using the Mac it is important the the CR to LF translation be done. If you use a UNIX-style FTP client, type "ASCII" before you send it. If you are using WS_FTP, be sure to click the ASCII radio button (and don't forget to switch back to binary before you download any executables...).
- Be sure to set your script to executable. You can use the UNIX "chmod" command to set the script as executable (e.g. chmod 755 script.cgi).
- Check and make sure the first line in every script is:
#!/usr/bin/perl
This tells the web server where Perl is located.
- Make sure that your script is sending out a Content-type header before it outputs any HTML. You should have a line in your script that looks like this:
print "Content-type: text/html\n\n";
This tells the browser that you are sending it HTML.
- If you have a UNIX prompt handy, try running your scripts from the command line to see if it generates any errors.
- If you're still stumped, visit our the Perl section of our Support forums to see if someone else has had a similar problem, or to create a new thread with your specific problem.
How can I see the errors generated by my script?
You can get your scripts to output errors to the browser by adding this line near the top of your script:
use CGI::Carp qw(fatalsToBrowser);
This tells Perl to send error messages to the browser.
Do you guys have a script to do "X"?
We don't offer pre-built scripts for our members to use, but you can find tons of great Perl scripts at these URLs: