error logs...

J

John ©

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.)
 
F

Fergus Toolan

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.
 
H

Henk

John © said:
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.)

Can you copy & past the script here please ?
 
P

Paul Lalli

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
 
A

A. Sinan Unur

(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?
 
J

John ©

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
 
P

Paul Lalli

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
 
J

John ©

Read the FAQ.... oh wait, I'm not allowed to be snide... okay then, read
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
 
J

John ©

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
 
J

John ©

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
 
P

Paul Lalli

John wrote:

(snipped)


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
 
P

Paul Lalli

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

#!/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
 
J

John ©

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
 
P

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
 
J

John ©

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
 
A

A. Sinan Unur

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.
 
J

John ©

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,

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
 
E

Eric Bohlman

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.
 
N

nobull

John © said:
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.
 
B

Brian McCauley

Eric Bohlman said:
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/[email protected]

--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top