did not produce a valid header

S

Sherm Pendley

Joe said:
I am getting a "did not produce a valid header" error when I run the
script through the browser. I ran the script in the command prompt and
I was fine.

"The script"? What script? I don't see any script. :)

Anyhow, first read "perldoc -q 500" for some general pointers to debugging
CGI scripts.

This error in particular means that either your script produced some sort of
output (a warning, perhaps) before producing HTTP headers, or it produces no
HTTP headers at all.

In particular, since you're using Perl's CGI module, make sure you're calling
its header() method before you print any other output.

Strictly speaking, by the way, this has nothing to do with the Perl language.
The error in question is produced by your web server, in response to the lack
of HTTP headers printed by your script; you'd get the same results if you had
written your script in Python (or whatever). You might get better answers by
posting in a CGI group, such as comp.infosystems.www.authoring.cgi.

sherm--
 
J

Joe

Hi Everyone,

I am getting a "did not produce a valid header" error when I run the
script through the browser. I ran the script in the command prompt and
I was fine.
"begin failed--compilation aborted at <scriptname> line 1459.

This line is doiing a
use CGI;

Even if I comment this off I am getting error where ever I have use:
Even if I use a
use strict; I am getting an error there. Could anyone please advice.
Thanks a lot!

Joe
 
A

A. Sinan Unur

Hi Everyone,

I am getting a "did not produce a valid header" error when I run the
script through the browser. I ran the script in the command prompt and
I was fine.
"begin failed--compilation aborted at <scriptname> line 1459.

This line is doiing a
use CGI;

Even if I comment this off I am getting error where ever I have use:
Even if I use a
use strict; I am getting an error there. Could anyone please advice.
Thanks a lot!

Neither

use strict;

nor

use CGI;

cause errors by themselves. The strict pragma helps you detect errors.

Now, given that your script is failing to compile, and you have not
provided a short but complete script that we can run, and thereby
diagnose the problem, I suggest you read the posting guidelines for this
group to learn how you can help yourself, and help others help you.

Thank you.

Sinan
 
S

Sherm Pendley

Joe said:
I am getting 2.752 when I do perl -MCGI -e 'print "$CGI::VERSION\n";'

That's super. Why are you doing that?

Please quote some of the message you're responding to. Lots of folks read
messages in a news reader, one at a time, not a whole thread at a time in a
web browser. So when you post a reply, it's important to quote enough of the
message you're replying to for your reply to make sense.

sherm--
 
B

Brian Wakem

Joe said:
Hi Everyone,

I am getting a "did not produce a valid header" error when I run the
script through the browser. I ran the script in the command prompt and
I was fine.
"begin failed--compilation aborted at <scriptname> line 1459.


You have an error, probably in or very near line 1459.

This line is doiing a
use CGI;


Missing semi-colon on previous line?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top