Knowledgebase: Information On Perl
For debugging purposes, should I execute the script through the web or SSH?
Posted by Roy Petersen on Feb-15-2007 12:16 PM
SSH. You will get much more information about the cause of the problem through the command-line than through the web. Below is an example:

Case I: We execute the Perl script through the web and get the following error: "Internal Server Error: Premature End of Script Headers". Given this information, we know the problem could be with the permissions, a syntax error, or the process was killed.

Case II: We execute the Perl script through the command-line and receive the following output: syntax error at ./script.cgi line 9, near "@list shift" Execution of ./script.cgi aborted due to compilation errors.

Which method yields the most useful information? SSH. We now know that the problem is a syntax error on line 9 of the Perl script, versus the "could be anything" problem we receive through the web.