Have you check error.log? There's usually some good info in there regarding script failures. And you might want to 'use cgi'...save doing all that reading and parsing of the request yourself. There's plenty of info in and around the Monestary regarding CGI...have a look in the Tutorials section to get started.