error logs...

Discussion in 'Perl Misc' started by John ©, Jun 24, 2004.

  1. John ©

    John © Guest

    I was under the impression that if you write a script in Perl that has
    errors in it, you will get some kind of error page...

    Is this true too for scripts on websites?

    I am just starting, testing things out (you know with the simple 'print
    etc...')
    Once it worked, but I added another line of print and it now goes to "The
    page cannot be displayed" (500 error)

    Not the error page I expected.

    this simple script is at
    http://www.sigmachi-iotadelta.com/cgi-bin/GETTIMETEST.cgi

    Thanks in advance for any help

    (And for the rude people that say I should read documentation or FAQ, first
    of all I don't know where the FAQ is, and I AM reading a book on Perl, but
    the book only says that you get an error page that tells you basically where
    the error is located, so if you have snide comments, please save them and
    let those who actually want to help answer.)

    --
    Best,
    John ©
    John ©, Jun 24, 2004
    #1
    1. Advertising

  2. The web server will have error logs. If it is apache it will be in a
    subdirectory of the apache root directory called logs. The file you need
    is error.log Error messages should appear there.

    Fergus

    PS: That directory structure / filename is for standard apache
    installations you would need to chack the specifics for your system.

    John © wrote:
    > I was under the impression that if you write a script in Perl that has
    > errors in it, you will get some kind of error page...
    >
    > Is this true too for scripts on websites?
    >
    > I am just starting, testing things out (you know with the simple 'print
    > etc...')
    > Once it worked, but I added another line of print and it now goes to "The
    > page cannot be displayed" (500 error)
    >
    > Not the error page I expected.
    >
    > this simple script is at
    > http://www.sigmachi-iotadelta.com/cgi-bin/GETTIMETEST.cgi
    >
    > Thanks in advance for any help
    >
    > (And for the rude people that say I should read documentation or FAQ, first
    > of all I don't know where the FAQ is, and I AM reading a book on Perl, but
    > the book only says that you get an error page that tells you basically where
    > the error is located, so if you have snide comments, please save them and
    > let those who actually want to help answer.)
    >
    Fergus Toolan, Jun 24, 2004
    #2
    1. Advertising

  3. John ©

    Henk Guest

    "John ©" <> wrote in message
    news:b0FCc.2122$...
    > I was under the impression that if you write a script in Perl that has
    > errors in it, you will get some kind of error page...
    >
    > Is this true too for scripts on websites?
    >
    > I am just starting, testing things out (you know with the simple 'print
    > etc...')
    > Once it worked, but I added another line of print and it now goes to "The
    > page cannot be displayed" (500 error)
    >
    > Not the error page I expected.
    >
    > this simple script is at
    > http://www.sigmachi-iotadelta.com/cgi-bin/GETTIMETEST.cgi
    >
    > Thanks in advance for any help
    >
    > (And for the rude people that say I should read documentation or FAQ,

    first
    > of all I don't know where the FAQ is, and I AM reading a book on Perl, but
    > the book only says that you get an error page that tells you basically

    where
    > the error is located, so if you have snide comments, please save them and
    > let those who actually want to help answer.)
    >
    > --
    > Best,
    > John ©
    >
    >


    Can you copy & past the script here please ?
    Henk, Jun 24, 2004
    #3
  4. John ©

    Paul Lalli Guest

    On Thu, 24 Jun 2004, John © wrote:

    > I was under the impression that if you write a script in Perl that has
    > errors in it, you will get some kind of error page...
    >
    > Is this true too for scripts on websites?


    Only if you ask for them.

    > I am just starting, testing things out (you know with the simple 'print
    > etc...')
    > Once it worked, but I added another line of print and it now goes to "The
    > page cannot be displayed" (500 error)


    Read the FAQ.... oh wait, I'm not allowed to be snide... okay then, read
    this:

    http://www.perldoc.com/perl5.8.4/po...-line-but-not-the-browser.--(500-Server-Error)


    Your server is responsible for storing the error that perl actually
    generated in an error log. If you don't know where that log is, ask your
    system administrator.

    Now, as I said above, you can ask Perl to print the error messages to the
    browser instead of (just) the error log. To do that, add this line at the
    top of the program:

    use CGI::Carp qw(fatalsToBrowser);

    That will cause the fatal errors to be displayed on the browser window as
    well as the server logs.

    > Not the error page I expected.
    >
    > this simple script is at
    > http://www.sigmachi-iotadelta.com/cgi-bin/GETTIMETEST.cgi
    >
    > Thanks in advance for any help
    >
    > (And for the rude people that say I should read documentation or FAQ, first
    > of all I don't know where the FAQ is, and I AM reading a book on Perl, but


    The FAQ is located in a multitude of places. If you have command-line
    access to your perl installation, you can get to it by typing the command
    perldoc perlfaq
    at the command line. If not, the easiest location for you to access it
    might be
    http://www.perldoc.com/perl5.8.4/pod/perlfaq.html

    > the book only says that you get an error page that tells you basically where
    > the error is located, so if you have snide comments, please save them and
    > let those who actually want to help answer.)


    I hope this is helpful. By the way, now that you do know the location of
    the FAQ, there really is no excuse for not reading it. And if that's too
    snide for you, oh well. ;)

    Paul Lalli
    Paul Lalli, Jun 24, 2004
    #4
  5. "John ©" <> wrote in
    news:b0FCc.2122$:

    > (And for the rude people that say I should read documentation or FAQ,
    > first of all I don't know where the FAQ is, and I AM reading a book on
    > Perl, but the book only says that you get an error page that tells you
    > basically where the error is located, so if you have snide comments,
    > please save them and let those who actually want to help answer.)


    Have you heard of Google? Do you know that the FAQ is installed on your
    computer? If you do not have Perl installed on your development computer,
    why not? Have you seen the posting guidelines posted here frequently?


    --
    A. Sinan Unur
    (reverse each component for email address)
    A. Sinan Unur, Jun 24, 2004
    #5
  6. John ©

    John © Guest


    > Have you heard of Google?

    Google? Thanks on the internet right? You do a search for Perl, see what you
    get. Almost impossible to weed through the good and the bad without prior
    knowledge.

    >Do you know that the FAQ is installed on your
    > computer? If you do not have Perl installed on your development computer,
    > why not?


    FAQ not on my computer, why would it be? Why would I install Perl on my
    computer when I only rarely use it in web development.

    >Have you seen the posting guidelines posted here frequently?


    Didn't know I was supposed to look for a posting of guidelines. I read them
    now, now that I know they existed.

    I'll keep the:

    "Be extra cautious when you get upset
    - Count to ten before composing a followup when you are
    upset
    - Count to ten after composing and before posting when
    you are upset"

    part of the guidelines in mind.


    Thanks again.
    -John
    John ©, Jun 24, 2004
    #6
  7. John ©

    Paul Lalli Guest

    On Thu, 24 Jun 2004, John © wrote:

    > > Have you heard of Google?

    > Google? Thanks on the internet right? You do a search for Perl, see what you
    > get. Almost impossible to weed through the good and the bad without prior
    > knowledge.


    You can think I'm trolling if you want, but I feel the need to point out
    that the first google return for "Perl FAQ" returns www.perl.com/perl/faq
    which, of course, is the official Perl FAQ.

    Paul Lalli
    Paul Lalli, Jun 24, 2004
    #7
  8. John ©

    John © Guest

    >Read the FAQ.... oh wait, I'm not allowed to be snide... okay then, read
    >this:


    >http://www.perldoc.com/perl5.8.4/pod/perlfaq9.html#My-CGI-script-runs-from-

    the-command-line-but-not-the->browser.--(500-Server-Error)

    Thanks for actually giving the link. Obviously the 'snide' wasn't directed
    at you. Before you get too thinned skinned, you should note that it did say
    the 'rude' people. I mean I have no idea how everything works. The
    Guidelines says to lurk, but hey, I didn't even know there were guidelines
    and some people can be really unforgiving here. Sure it's annoying when
    thousands of different people do the same thing, but it's not like I am ONE
    person doing it A THOUSAND times ... it's my first time here, don't I get
    one slide?

    The comments were aimed at people like this one guy who was like "You're a
    newbie, you're lazy, go read the FAQ. You should know not to post this way,
    and to post that way." Just a bunch of rudeness without any substance. No
    links to where things are, just total unhelpfulness. If he's that upset,
    then just don't respond to me.

    So thanks again, and I hope you didn't get too upset for the comments that
    had nothing to do with you.

    Best,
    John
    John ©, Jun 24, 2004
    #8
  9. John ©

    John © Guest

    >You can think I'm trolling if you want, but I feel the need to point out
    >hat the first google return for "Perl FAQ" returns www.perl.com/perl/faq
    >which, of course, is the official Perl FAQ.


    >Paul Lalli



    Well when I posted before to a server, one guy was like go read the FAQ ...
    I figured it was a FAQ for the newsgroup and where would that be? He didn't
    give any help ... when I do google searches, I just did Perl, or Perl
    tutorial, or Perl help... and they talk like Perl is known already.

    But like I said, it's noted, so now I know. I think I'll just go back to my
    book.

    Thanks again,
    John
    John ©, Jun 24, 2004
    #9
  10. John ©

    John © Guest


    >
    > Can you copy & past the script here please ?
    >
    >

    --------------------------------------------------------------------------

    #!/usr/local/bin/perl5


    $GetTime = 5;
    $NextOne = 6;

    print "This is a test of $GetTime\n"
    print "The next number is $NextOne\n"

    --------------------------------------------------------------------------

    Pretty basic, eh? If the <$NextOne = 6;> and <print "The next> etc.. is not
    in there, then it shows:

    This is a test of 5

    But when the script it like it is above, it gives a HTTP 500 Internal server
    error.

    I am going to keep reading.
    Thanks for the help. I appreciate it.

    -John
    John ©, Jun 24, 2004
    #10
  11. John ©

    Paul Lalli Guest

    On Thu, 24 Jun 2004, Purl Gurl wrote:

    > John wrote:
    >
    > (snipped)
    >
    > > I am just starting, testing things out (you know with the simple 'print
    > > etc...')
    > > Once it worked, but I added another line of print and it now goes to "The
    > > page cannot be displayed" (500 error)

    >
    > If your code is not too long, quarter of a page or less, post it
    > here so others can look at it.
    >
    > If really long, post a "plaintext" hyperlink to your code.
    >
    > None can help you without looking at your code.


    I disagree. I believe that pointing the OP find where the error message
    might be stored, as well as showing him/her how to have CGI::Carp display
    the error messages in the browser window, are very helpful. Teaching a
    man to fish, and all that.

    Paul Lalli
    Paul Lalli, Jun 24, 2004
    #11
  12. John ©

    Paul Lalli Guest

    On Thu, 24 Jun 2004, John © wrote:

    > >
    > > Can you copy & past the script here please ?
    > >
    > >

    > --------------------------------------------------------------------------
    >
    > #!/usr/local/bin/perl5
    >
    >
    > $GetTime = 5;
    > $NextOne = 6;
    >
    > print "This is a test of $GetTime\n"
    > print "The next number is $NextOne\n"
    >
    > --------------------------------------------------------------------------
    >
    > Pretty basic, eh? If the <$NextOne = 6;> and <print "The next> etc.. isnot
    > in there, then it shows:
    >
    > This is a test of 5
    >
    > But when the script it like it is above, it gives a HTTP 500 Internal server
    > error.
    >
    > I am going to keep reading.
    > Thanks for the help. I appreciate it.



    John,

    Your error is being caused by a missing semi-colon on the first print
    line.

    I strongly suggest you follow the advice I gave earlier, to add the line:

    use CGI::Carp qw/fatalsToBrowser/;
    right below the #!/usr/local/bin/perl5 line. This will cause the error
    message to be printed to the browser, so you could see that you were
    missing the semicolon.

    Paul Lalli
    Paul Lalli, Jun 24, 2004
    #12
  13. John ©

    John © Guest

    >I strongly suggest you follow the advice I gave earlier, to add the line:

    >use CGI::Carp qw/fatalsToBrowser/;
    >right below the #!/usr/local/bin/perl5 line. This will cause the error
    >message to be printed to the browser, so you could see that you were
    >missing the semicolon.


    >Paul Lalli


    Paul,

    I did add that line, and tried it. What I got back was:

    "Software error:

    Execution of ./testing.cgi aborted due to compilation errors.

    For help, please send mail to the webmaster, etc..."

    Although I'll admit this is more on the line I want... I know the simple
    script has errors... or actually I am not worried about it working, I just
    want an easy way to figure out what is wrong when hopefully I move onto
    larger scripts.

    Thanks for the help,
    John
    John ©, Jun 24, 2004
    #13
  14. John ©

    Paul Lalli Guest

    On Thu, 24 Jun 2004, John © wrote:

    > >I strongly suggest you follow the advice I gave earlier, to add the line:

    >
    > >use CGI::Carp qw/fatalsToBrowser/;
    > >right below the #!/usr/local/bin/perl5 line. This will cause the error
    > >message to be printed to the browser, so you could see that you were
    > >missing the semicolon.

    >
    > >Paul Lalli

    >
    > Paul,
    >
    > I did add that line, and tried it. What I got back was:
    >
    > "Software error:
    >
    > Execution of ./testing.cgi aborted due to compilation errors.
    >
    > For help, please send mail to the webmaster, etc..."


    Really? It didn't say
    syntax error at testing.cgi line 8, near "print"
    anywhere? That's odd. I'm wondering what version of Perl your host is
    running.

    > Although I'll admit this is more on the line I want... I know the simple
    > script has errors... or actually I am not worried about it working, I just
    > want an easy way to figure out what is wrong when hopefully I move onto
    > larger scripts.


    That CGI::Carp line is how you have perl display for you the error
    messages to the browser. These are the same error messages you'd receive
    if you were running the script just on the command line. You won't get
    more information from Perl itself.

    If you are curious about what version you're running as well, add this
    line to your script:

    printf "Ver: v%vd\n", $^V;

    If the version isn't at least 5.6 (preferably 5.8), you might want to
    consider at least asking your host if they'll upgrade.


    Paul Lalli
    Paul Lalli, Jun 24, 2004
    #14
  15. John ©

    John © Guest


    >If you are curious about what version you're running as well, add this
    >line to your script:


    >printf "Ver: v%vd\n", $^V;


    I added that and it gave back:

    Ver: v%vd

    Whatever that means... I have been looking through docs and faq of the
    server, but I can't pin down exactly which Perl they are using. I'll keep
    looking.

    Thanks again,
    John
    John ©, Jun 24, 2004
    #15
  16. "John ©" <> wrote in
    news:04GCc.4775$:

    >>Read the FAQ.... oh wait, I'm not allowed to be snide... okay then,


    > The comments were aimed at people like this one guy who was like
    > "You're a newbie, you're lazy, go read the FAQ. You should know not
    > to post this way, and to post that way." Just a bunch of rudeness
    > without any substance. No links to where things are, just total
    > unhelpfulness. If he's that upset, then just don't respond to me.


    The fact that you made you comments before you received any 'snide' remarks
    explains my unhelpfulness. If you had just made a request without a
    preemptive attack, you would have received help from me as well. OTOH, you
    have already received excellent advice, so you probably don't care.

    --
    A. Sinan Unur
    (reverse each component for email address)
    A. Sinan Unur, Jun 25, 2004
    #16
  17. John ©

    John © Guest


    > The fact that you made you comments before you received any 'snide'

    remarks
    > explains my unhelpfulness. If you had just made a request without a
    > preemptive attack, you would have received help from me as well. OTOH, you
    > have already received excellent advice, so you probably don't care.
    >
    > --
    > A. Sinan Unur


    A. Sinan,

    I had already received 'snide' comments from a guy in the comp.lang.perl
    group ... I was supposed to realize that that newsgroup was defunct. That
    there were FAQ's, that there were guidelines. That because I was a newbie I
    was lazy. He even got on my case for typing PERL instead of Perl, among
    other things... and that was the first time I had ever posted.

    So again, sorry if you were thinned skinned about a disclaimer that
    wasn't aimed at you, but for the people that sincerely are rude out there.

    Cheers,
    John
    John ©, Jun 25, 2004
    #17
  18. John ©

    Eric Bohlman Guest

    "John ©" <> wrote in
    news:rxKCc.4476$:

    > I had already received 'snide' comments from a guy in the
    > comp.lang.perl
    > group ... I was supposed to realize that that newsgroup was defunct.
    > That there were FAQ's, that there were guidelines. That because I was
    > a newbie I was lazy. He even got on my case for typing PERL instead of
    > Perl, among other things... and that was the first time I had ever
    > posted.


    Usenet newsgroups (and for that matter, Usenet itself) have characteristics
    that meet many of the anthropological criteria for cultures. When visiting
    a foreign culture, it is normally considered necessary to make at least
    some effort to familiarize oneself with it. For example, an American who
    visits England and is surprised, or worse, indignant to find out that
    people drive on the left side of the road hasn't put in that effort. There
    is a stereotype that says that most Americans behave that way (we mostly
    don't but the squeaky wheel gets the grease) and in fact it has a name: the
    "ugly American." You're showing some signs of it.
    Eric Bohlman, Jun 25, 2004
    #18
  19. John ©

    Guest

    "John ©" <> wrote in message news:<04GCc.4775$>...
    > >Read the FAQ.... oh wait, I'm not allowed to be snide... okay then, read
    > >this:

    >
    > >http://www.perldoc.com/perl5.8.4/pod/perlfaq9.html#My-CGI-script-runs-from-

    > the-command-line-but-not-the->browser.--(500-Server-Error)


    > The comments were aimed at people like this one guy who was like "You're a
    > newbie, you're lazy,


    That's "like" in the sense that if you rearrange my words you can make
    up that sentence.

    What I actually said was that experience has shown us that people who
    use the word "newbie" in their _subject_ lines usually turn out to be
    people who are also being lazy. This is true. I didn't make it true,
    I just observed it to be true so there's no point you getting upset at
    me about it.

    I advised you, therefore, that you should avoid using the word
    'newbie' in your subject lines if you didn't want people to start
    reading your posts with a negative predisposition.

    > ...go read the FAQ.


    Yes, I advised you to go read the FAQ. You think this was not
    helpfull advice? Actually, you should have been given the advice
    "Before you post a question, look for a FAQ" by whomever gave you
    Usenet access. If they didn't give you this advice then you should
    complain to them and noone else.

    > You should know not to post this way, and to post that way."


    Yes, appart from not checking the FAQ, you did some other things that
    are also considered rude in the environment of a technical Usenet
    group. I pointed these out to you so that you could avoid them in
    future. You think this was not helpfull advice?

    > Just a bunch of rudeness


    When you stumble into a new cultural environment and start interacting
    without standing on the sidelines for a moment to observe the local
    social customs this is rude (and not just in cyberspace). When
    someone points out that you've just broken the local customs this is
    not, in itself, rude it is an attempt to help. When you are the
    1000th person, the person trying to help you is likely to be terse and
    have a somewhat exasperated tone. Try to realise that you are the
    1000th person and that the tersity and exasparation are consequences
    of this fact and you should not interpret them as "being rude". If
    you insist on regarding them as "being rude" then you should also
    remember that you were rude first.

    > without any substance.


    I actually offered to do a detailed line-by-line criteque of your
    script which, had it actually been your script, would probably have
    helped your Perl programming a lot. This was a very substancial
    offer.

    But, as I suspected, the script in question was not one you'd wrote
    but one you'd picked up somewhere. Like I said, a critique of such a
    script would not have helped you.

    > No links to where things are, just total unhelpfulness.


    The whole point about a FAQ is that you consult it first before you
    ask a question. If "where's the FAQ" is a legitimate question the
    this defeats the point of there being a FAQ. FAQs have to be easy to
    find.

    > If he's that upset, then just don't respond to me.


    Just because I didn't spoon-feed you didn't mean I was upset. I
    treated you like an adult who'd made a social gaff a would probably
    want to avoid repeating it. The "just don't respond" approach doesn't
    work. Not only would you not be helped but also it would mean that
    people who did take the time the lurk on the sidelines in order to
    figure out what was accepted behaviour would think that what you did
    was OK.
    , Jun 25, 2004
    #19
  20. Eric Bohlman <> writes:

    > "John ©" <> wrote in
    > news:rxKCc.4476$:
    >
    > > group ... I was supposed to realize that that newsgroup was defunct.
    > > That there were FAQ's, that there were guidelines. That because I was
    > > a newbie I was lazy. He even got on my case for typing PERL instead of
    > > Perl, among other things... and that was the first time I had ever
    > > posted.

    >
    > Usenet newsgroups (and for that matter, Usenet itself) have characteristics
    > that meet many of the anthropological criteria for cultures. When visiting
    > a foreign culture, it is normally considered necessary to make at least
    > some effort to familiarize oneself with it. For example, an American who
    > visits England and is surprised, or worse, indignant to find out that
    > people drive on the left side of the road hasn't put in that effort. There
    > is a stereotype that says that most Americans behave that way (we mostly
    > don't but the squeaky wheel gets the grease) and in fact it has a name: the
    > "ugly American." You're showing some signs of it.


    Yes, I must confess, that I tend to assume that people who come here
    and behave this way are Americans. However I was in at least one
    recent case shown to be wrong. 'Player' revealed himself to be a Brit
    (like me).

    http://groups.google.com/groups?threadm=

    --
    \\ ( )
    . _\\__[oo
    .__/ \\ /\@
    . l___\\
    # ll l\\
    ###LL LL\\
    Brian McCauley, Jun 25, 2004
    #20
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mike Delaney

    Floating Point Powers and Logs?

    Mike Delaney, Oct 2, 2004, in forum: VHDL
    Replies:
    2
    Views:
    576
    David Bishop
    Oct 3, 2004
  2. Gnaneshwar Babu

    extracting event logs to a file

    Gnaneshwar Babu, Dec 31, 2003, in forum: Perl
    Replies:
    0
    Views:
    707
    Gnaneshwar Babu
    Dec 31, 2003
  3. Remco Groot Beumer

    Variables are overwritten when another person logs in

    Remco Groot Beumer, Nov 5, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    321
    Mark Fitzpatrick
    Nov 5, 2003
  4. Brian Lowe
    Replies:
    4
    Views:
    346
    Brian Lowe
    May 26, 2004
  5. =?Utf-8?B?SmltIEhlYXZleQ==?=

    IIS Logs

    =?Utf-8?B?SmltIEhlYXZleQ==?=, Jun 6, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    447
    John Saunders
    Jun 6, 2004
Loading...

Share This Page