One thing to be careful about with CGI stuff is to make sure you look exactly at what you get. Like, with telnet, or wget/curl/fetch/etc. Once a web browser touches it, who knows what happens; View Source things often have already done some transformation, so don't show you the raw bytes the server handed back. Which may or may not be the raw bytes your app handed it; there are lots of layers in web stuff, and you gotta track down where things are failing to do what you expect.