Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Print Header in Perl v5.8.7

by aukjan (Friar)
on Aug 19, 2005 at 11:26 UTC ( [id://485072]=note: print w/replies, xml ) Need Help??


in reply to Print Header in Perl v5.8.7

Show us some of the code that's failing. Are you using CGI.pm? Is it installed correctly in the new installation? Please a bit more detail...

Go Fish!

Replies are listed 'Best First'.
Re^2: Print Header in Perl v5.8.7
by Gorby (Monk) on Aug 19, 2005 at 16:54 UTC
    Here's the code:

    #!/usr/bin/perl -w use CGI qw(:all); use strict; open(TESTFILE, ">thetestfile") || die "Cannot open $!"; close(TESTFILE); print header; print "DONE";
    The result is the following on the browser:

    CGI Error

    The specified CGI application misbehaved by not returning a complete set of HTTP headers.

    What does this mean? What's going wrong?

    Thanks in advance.

    Gorby

      Your program couldn't open the file and died before it printed the header. I'm sure if you look in the error log you'll see the message.

      If you print the header before you try to open the file, you won't see the 500 error.

        It didn't die. When I run the .cgi program from the command prompt, it works just fine. It outputs the html headers before printing DONE. Somehow, the html header isn't being sent to the browser.

        Would you have more suggestions for me?

        Thanks.

        Gorby

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://485072]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-04-20 02:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found