Debugging an Application

This case study is a bit different from the others, since it doesn't explain a particular application, rather than the development of an application. The application is a rather simple one: tell the user what host the web server believes made the HTTP request and display it using a chtml template. We will use Perl for this example, but many of the same concepts apply in other languages.

You can also view information about common error messages you may see either during script development or even after the script is in production use.

This case study will show several versions of the same script, and enable you to actually try the buggy scripts to see what the output will look like. For each link which executes a script, you will see a small section at the top which explains the output and lets you proceed. If you are not on a browser which supports embedded HTML objects, you will need to use the browser back button after trying the test scripts to find a link to the next page.

Before starting, be warned that throughout this documentation we will call the name of the script "client.cgi". However, in order to be able to try different versions, the actual scripts are "client1.cgi", "client2.cgi", etc. This subtlety is important when you view the error messages.