Where is the perl interpreter (or program) located?


If you are running a script via the command line (and you have SSH access enabled), or you are uploading a perl script to place in the cgi-bin, the perl interpreter is located at /usr/bin/perl, not /usr/local/bin/perl.

Also, it is important that when you upload a script from a Windows (or Mac) system to be run on our servers (which use Linux), the upload must be completed in ASCII mode (not Binary mode) unless you know what you are doing.

The shebang line (i.e. the first line of the file that starts #! tells Unix/Linux which interpreter to use to run the script) is sensitive to the Carriage Return (or \r) character - the system expects it to end with a Linefeed character, or \n. Windows systems use \r\n to signal a new line, whereas \r alone is used with Macs). Therefore, if a \r (or any other) character is found before a \n in the shebang line, it will be considered part of the program location and the script will fail to run.

If this happens via the cgi-bin, you will probably see a Server Misconfiguration Error (500 Error), as no headers are returned. If it's via the command line, you will probably find a message saying that the program /usr/bin/perl cannot be found instead (actually, it's /usr/bin/perl\r cannot be found).

  • 104 Users Found This Useful
Was this answer helpful?

Related Articles

Why does my script fail to run in the cgi-bin?

There are a number of reasons as to why you cannot get a script to run in your cgi-bin. They...

Can I install programs such as phpBB and Mambo?

All our accounts provide access to a wide-range of languages and utilities Using these, you are...

How do I enable register_globals (PHP)?

Since version 4.2.0 of PHP, the register_globals setting has been disabled by default on all new...

What is my Web Root or Document Root?

Some scripts/programs may ask you for your web root (or document root) when performing the...

How do I create a cron job?

A cron job (run by the cron daemon, or cron service) is a request for the server to run a...