in reply to 'Premature end of script' errors running script as CGI

That's not a CGI script. Adding content-type headers would be rather superfluous ;)

Just run it from the command-line. It's not meant to be run by your webserver. An added benefit from running it normally would be that you can see STDOUT and STDERR, and debug it from there.

  • Comment on Re: 'Premature end of script' errors running script as CGI