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

CGI Error

by Lhamo_rin (Friar)
on May 31, 2006 at 14:32 UTC ( [id://552800]=perlquestion: print w/replies, xml ) Need Help??

Lhamo_rin has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: CGI Error
by davorg (Chancellor) on May 31, 2006 at 14:49 UTC

    Like gellyfish, I'm confused by what a "CGI editor" might be, but I can have a guess at what your problem is.

    Either your program isn't outputting the correct CGI headers (you need to, at least, print a Content-type header - use the header method from CGI.pm) or there is an error in your program and it's outputting an error message before it gets to output the headers. In this case, the real error will almost certainly be in your web server error log.

    Also see Suffering from Buffering.

    --
    <http://dave.org.uk>

    "The first rule of Perl club is you do not talk about Perl club."
    -- Chip Salzenberg

Re: CGI Error
by Asim (Hermit) on May 31, 2006 at 14:58 UTC

    As gellyfish mentioned, there's a lack of data that can really help you. I would first off recommend you take a look at the links offered at Intro to the Monastery to get an idea of the best way to ask for help. It's not 'cause we're snobbish, but simply so that folks don't have to spend time doing what I'm about to do in the next paragraph: Guess at Your Situation. Plus, you don't have to play "guess what we need" quite so much, so you and we all win! So, the questions/comments:

    1. If you're not, Use CGI.pm. REALLY.
    2. What is the name of your editing program?
    3. What OS and Web Server are you using?
    4. Are you sending a header with your code? (CGI.pm makes sending headers dead easy!)
    5. Have you the correct permissions for the code?

    That error tends to come with bad, or no, headers being sent with your program. And that's one of many possible issues. You might want to also Google for that error; it's a very common one that has little, sometimes, to do with Perl, and a lot to do with how your Web Server serves up CGI (which is lanaguage-neutral).

    Finally, a few (thousand) words from Ovid:

    Does any of this help?

    ----Asim, known to some as Woodrow.

      Thanks for the guidance. It does help. I realize my question was vague and rather "amateurish". I was in too much of a hurry. Thanks,
Re: CGI Error
by gellyfish (Monsignor) on May 31, 2006 at 14:34 UTC

    Please explain what a "CGI editor" is.

    /J\

Re: CGI Error
by ptum (Priest) on May 31, 2006 at 14:53 UTC

    CGI development requires that the first thing that your script prints be a properly formatted header so the browser can figure out what kind of an object it is. Generally if you're using CGI, this means that you should "print header;" as early in the program as possible.

    This kind of error is usually caused by your script abnormally ending, often because of a file permissions error or some difference between the command-line and web environments. The following code, placed at the top of your script, will help:

    use CGI qw(:standard); use CGI::Carp qw(fatalsToBrowser); use strict; print header;

    No good deed goes unpunished. -- (attributed to) Oscar Wilde
Re: CGI Error
by marto (Cardinal) on May 31, 2006 at 14:50 UTC
    Lhamo_rin,

    Perhaps I am missing something here but IMHO the description of your issue could be better. Please read How do I post a question effectively? if you have not already done so. You could help us to help you by explaining in more detail what you have, if there is anything mentioned in the server logs (error_log for apache for example). Also check the permissions on this file, and have a read at ovid's fantastic Web Programming Using Perl which is chock full of general good advice and CGI debugging hints.

    Hope this helps.

    Martin

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-04-24 05:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found