in reply to Premature end of script headers?

hi,
this is usually due to missing content type header. If you
use CGI;
you could just
print header;
which by default prints a HTML content type Header:
print "Content-type: text/html\n\n";
Make sure this gets printed before the script might die.

Hope this helps.

Regards... Stefan

Replies are listed 'Best First'.
Re: Re: Premature end of script headers?
by MrCromeDome (Deacon) on Jun 21, 2001 at 20:58 UTC
    Please don't take this as me being rude. I think I didn't explain myself well enough.

    If I were missing a header altogether though, wouldn't I get a malformed header error, not a premature end of header?

    I have a line in my code that prints print "Content-Type: text/html\n\n"; before anything else. What has me confused is why the script runs in the browser with some parameters but not with others when the only thing I changed is the database I was using.

    Regardless of the parameters passed, the script runs fine from the command prompt. The header info produced in that manner looked ok to me too. I believe that the problem has nothing to do with the actual header. . . I think that perl dying in that manner is producing the header problems.

    Still stumped,
    MrCromeDome

      Please don't take this as me being rude.

      I no way :-)

      I'm not really familiar with the internals and the background of all this. I'm telling you my experiences. Whenever I encountered that error it was due to missing header information.
      Well, I might be wrong with this; but it's what I have experienced.

      Sorry if this isn't what you were looking for.

      Regards... Stefan