in reply to Re^2: Print Header in Perl v5.8.7
in thread Print Header in Perl v5.8.7

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.

Replies are listed 'Best First'.
Re^4: Print Header in Perl v5.8.7
by Anonymous Monk on Aug 19, 2005 at 17:56 UTC
    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

      You are using a relative path. The current directory is not what you think it is. Your script dies before printing valid HTTP headers. Always print out valid headers first. Or use CGI::Carp with the fatalsToBrowser option.

      It didn't die.

      How do you know that? Did you read the error message in the error log or are you just guessing? Do you know why it might die when run from the web server but not from the command line? I do. Corion does.

      You don't have to believe me and you certainly don't have to take my advice, but if you don't really want help and aren't willing to take advice from people who've solved this problem at least a few times before, please make a note to that effect in your original post so we don't have to waste our time giving answers that you will ignore.