nadersolutions.com
home   |   about us   |   contact us   


  office: 407-448-3565   
fax: 407-650-3038   
   
information
 
 
 
 
 
 
Frequently Asked Questions
Scripting Issues

What is the version of Perl
We are currently running Perl version 5.00502

What is the path to Perl?rl?
Below are all of the paths to our perl binary:

/usr/bin/perl
/usr/local/bin/perl5.00502
/usr/local/bin/perl

Why can't I execute perl scripts from shell?
You can but most likely you are using the wrong syntax. Do not use the syntax "./ to execute your perl scripts through Telnet, as you will get a "Permission denied: program not allowed." error.
Instead, use the syntax "perl" to execute you perl scripts though Telnet. This syntax will still return any standard output or standard error returned by the script for debugging purposes.

Does Nader Solution frequently upgrade Perl with new build releases?
Yes. Once a new build of Perl has been deemed as stable versus experimental, Nader Solution will promptly upgrade to this version of Perl.

How should I set my file permissions on a Perl script?
Often times, permissions are set very leniently in order to avoid any permissions problem. This is not a good idea. Your Perl scripts should have the appropriate permissions depending on the function of that particular script.
First, all scripts should be set to the owner (you) having read, write and execute privilege (rwx) regardless of the function of the Perl script.
Next, you should ask yourself if you want people (visitors) to your website to be able to execute the Perl script. This is most likely the case. Under these conditions, your script would be set to world readable and executable (r-x). Do not give the world write permission on the Perl script! It is not necessary and may lead to problems!
If your script is not going to be executed through the web and only you will be executing the script through Telnet (there are various reasons for having a script operate under these conditions), then you set the script to no world permissions (---).
The group permissions should be set to read and executable (r-x) if the script is to be executable via the web. Otherwise, set your group permissions to nothing (---).
With this information, you have the following permissions breakdown:
Executed via the web by anyone: chmod 755
Executed by only yourself thought the command line: 700
Often times, a Perl script will open a file for writing. This is the case in guest book's and bulletin boards, where the information is received from the form and written to a certain file. The permissions of this particular file are now important.
Many times, the author of a Perl script you use on your account will require you to set this file to rwxrw-rw-, or chmod 766, which allows write access to the world. This is not a good idea and is unnecessary.
Files that need to be written to by way of a Perl script can be set to the default permissions of rw-r--r--, or chmod 644. This will work fine with our setup.
Finally, never set your file permissions to rwxrwxrwx, or chmod 777. This is not necessary, may cause a security problem on your website, and will cause your Perl script to not execute at all!

What are the correct file extensions for Perl scripts?
Your Perl scripts can have the extension .pl or .cgi. However, Perl scripts that are going to produce output to the web (world readable) would use the extension .cgi. Perl scripts that are only meant to be executed by yourself via the command line or even scripts which may be executed through the web without any output should be set to the .pl file extension.

Should I upload my Perl scripts in ASCII or Binary mode?
You should always upload your Perl scripts in ASCII mode via FTP. If you upload your scripts in binary mode, the scripts will not work and you will get an "Internal Server Error: Premature End of Script Headers" error (500 Internal Server Error). It is very important to remember to only upload your Perl scripts in ASCII mode!

How do I execute my Perl scripts through Telnet/SSH?
Issue the command "perl " from the command line, where "script name" is the relative or absolute path to the Perl script. If problems with the execution of the script are encountered, they will be reported on the terminal by the Perl Debugger.

Can I use a "cgi-bin" on my account for my Perl scripts?
Certainly. You may use a directory named "cgi-bin" or anything you wish to for your Perl scripts.

Do my Perl scripts have to be in the cgi-bin?
No. Sometimes a person thinks that their Perl scripts must reside in the cgi-bin directory in order to work. This is not true, there is nothing special about that directory. This name has simply evolved out of tradition. You can use this directory for your scripts, which is created on your account when setup. However, feel free to put your Perl scripts anywhere within your account.