Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k & phranque

Message Too Old, No Replies

Debugging CGI script

What is wrong

10:56 pm on Mar 6, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:June 14, 2003
votes: 0

I am having the standard problem of just getting the premature end of headers error message which explains nothing.

I have cut down a script as far as this

#!/usr/bin/perl -w
print "<html> Hello </html>"

It still gives the same error. I think permissions are OK and the script runs on the command line.

Can anyone tell me how to get decent error messages out of the system or what the problem is likely to be and how to fix it.

12:05 am on Mar 7, 2006 (gmt 0)


WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:July 31, 2003
votes: 1

There's always the server error logs --

You need to let the browser know what's coming first.

print "Content-type: text/html\n\n";
11:39 am on Mar 8, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 18, 2003
votes: 0

use CGI::Carp [search.cpan.org] qw(fatalsToBrowser);

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members