ZydecoSue has asked for the wisdom of the Perl Monks concerning the following question:
I'm running into a 500 error with a simple CGI.pm based script and I can't seem to resolve it.
#/user/bin/perl -wT use strict; use CGI ':all'; use CGI::Carp qw(fatalsToBrowser); $| = 1; print header(), start_html('Test'), 'Hello, World!', end_html();
Here's the form I'm using to invoke it.
<HTML> <HEAD> <TITLE>Test</TITLE> </HEAD> <BODY>Click me:<BR> <form action="/cgi-bin/hello.cgi" method="POST"> <input type="Submit" NAME="submit" Value="Do-it!"> </form> </BODY> </HTML>
When run from my telnet window, it runs fine, producing this output:
> perl -wT hello.cgi '' Content-Type: text/html <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> <HTML><HEAD><TITLE>Test</TITLE> </HEAD><BODY>Hello, World!</BODY></HTML>
This look right to me; however, when called from my sample form, I get a server 500 error. There is only one line added to the error log: Premature end of script headers: /home/mypath/cgi-bin/hello.cgi
I have checked permissons (755) on the script and the parent directories. Perl 5.05.003, Apache 1.3.12; FreeBSD 4.0; CGI.pm version unknown;
I'm out of ideas; either I'm, like, incredibly lame or something else is wrong. Please help.
Edit: 2001-03-03 by neshura
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Premature Error using CGI.pm
by epoptai (Curate) on Feb 24, 2001 at 09:35 UTC | |
by myocom (Deacon) on Feb 24, 2001 at 09:40 UTC | |
by ZydecoSue (Scribe) on Feb 24, 2001 at 09:57 UTC | |
Re: Premature Error using CGI.pm
by aardvark (Pilgrim) on Feb 24, 2001 at 13:35 UTC | |
by Masem (Monsignor) on Feb 24, 2001 at 17:22 UTC | |
by a (Friar) on Feb 24, 2001 at 21:31 UTC | |
by tye (Sage) on Feb 25, 2001 at 01:04 UTC | |
by a (Friar) on Feb 25, 2001 at 10:02 UTC | |
Re: Premature Error using CGI.pm
by bladx (Chaplain) on Feb 25, 2001 at 02:45 UTC | |
Re: Premature Error using CGI.pm
by a (Friar) on Feb 24, 2001 at 10:12 UTC |