Gossamer Forum
Home : General : Perl Programming :

CGI Error - HTTP headers

Quote Reply
CGI Error - HTTP headers
Hello all, Thanks in advance for your help. I've installed Perl 5x on and Windows2000 box which files run fine under the command prompt, but when I try them in a browser I get: CGI Error The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are: Hello, World! The HELLO.PL file only contains

#! F:/PERL/BIN/PERL.EXE -w
print "Hello, World!\n";

Also, I tried backward slashes too but didn't work - same results. So, not sure what I'm doing wrong but the browser is seeing the code becuase it does return the Hello World portion. I'm a newbee here and any help is appreciated.
Quote Reply
Re: [angelohl] CGI Error - HTTP headers In reply to
You aren't printing a header.

Code:
#! F:/PERL/BIN/PERL.EXE -w
print "Content-type: text/html\n\n";
print "Hello, World!\n";

I'd recommend having a look at some of the perl books at amazon.com (or somewhere similar eg oreilly.com). There is also a lot of information online at perl.com and perldoc.com
Quote Reply
Re: [Paul] CGI Error - HTTP headers In reply to
Thanks Paul - that did the trick. Now that I know my servers configured correctly I can move on to learning Perl. Thanks again.