Troubleshooting CGI Programs

CGI programs launched from a web server run under a fundamentally different environment than they do when invoked from the command line. While you should always verify that your CGI program runs properly from the command line,[] this isn't enough to guarantee that your program will work when called from the web server.

[15] See the CGI.pm documentation for tips on command-line debugging.

You should get the CGI developing FAQ and a good tutorial on CGI developing to help you in this. Some of these references are listed at the end of this chapter. Here's a brief list of the frequent problems that arise in CGI developing. Almost all of them trigger those annoyingly unhelpful Server Error messages that you will soon come to know and hate.