Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: Odd behavior: CGI and warnings

by mandog (Curate)
on Oct 30, 2003 at 03:24 UTC ( [id://303187] : note . print w/replies, xml ) Need Help??

in reply to Odd behavior: CGI and warnings

Hello MichelleM

My guess is that either you access your undeclared variable before:

print "content-type: text/html\n\n";

... or that you have troubles with buffering. Generally error messages are flushed right off and other printing is buffered

This problem would manifest itself in the error log as something line "Premature end of Script Headers "

This may be clearer if you run your script at the command prompt and your warning comes before your header

You can turn off buffering by setting  $|=1

There is a really good nodo on buffering problems: but I can't find it... Suffering from Buffering

update: there is some apache 2.0 buffering discussion here

Replies are listed 'Best First'.
Re: Re: Odd behavior: CGI and warnings
by michellem (Friar) on Oct 30, 2003 at 15:03 UTC
    Actually, in this case, it comes after the headers. And running my script at the command line was how I figured out about the issue of warnings, because I was so puzzled. But thanks for the details on buffering, that comes in handy.