You're running a "cgi" script from the command line more than likely. check to see if it 'use CGI'. If its meant to be a CGI script, test it with a browser, if not, remove all the CGI stuff from the code. I can't tell much more from the desc, and this post probly should be in SOPW.