From: Doug H on
Thanks to both repliers.

After refering to my ISP web pages about using Perl I discovered that one
needs to use

use CGI::Carp qw(fatalsToBrowser warningsToBrowser);

to have errors display. I tried this and it worked--I got statement errors
in the script I was trying. However I could not figure out what the errors
actually meant. The statements looked okay to me. Then I had to go to do
something else and then this evening when I got back to trying it I could
not even get these error messages to show! Very discouraging. I do not even
know whether using the above line means that I do not have to use the "use
CGI;" line as well.

In any case I think I will just have to start from scratch and try to get
something to run and show errors if I have them in statements.

You said

> Dahhh, would have been nice to know this tidbit of information from the
> beginning, please see "perldoc -q 500".

How does one refer to "perldoc -q 500"? Sorry. I have programmed in octal
(in 1958 before there were languages), Fortran, Basic, Visual Basic, COBOL,
PL1 but am new to Perl and the book I have been using to learn it, seems to
disagree with some of the coding I find on the web. It makes it all very
exasperating.

Doug


From: J�rgen Exner on
"Doug H" <courses(a)shaw.ca> wrote:
>After refering to my ISP web pages about using Perl I discovered that one
>needs to use
>
>use CGI::Carp qw(fatalsToBrowser warningsToBrowser);
>
>to have errors display.

That is not quite correct. Normally error messages will be sent to
STDERR and thus be displayed on the terminal together with STDOUT.
However because in a web server environment there is no terminal
anything sent to STDERR is being redirect to the error log where it can
be examined later at your convenience.

The above import shortcuts that method and instead -besides other
things- redirects the error messages from STDERR to STDOUT, thus
including them in the regular response from the CGI program to the web
server.

>[...] I could not even get these error messages to show!

Did you check the web server's error log?

>Very discouraging. I do not even
>know whether using the above line means that I do not have to use the "use
>CGI;" line as well.

CGI and CGI::Carp are two totally different modules.

>> Dahhh, would have been nice to know this tidbit of information from the
>> beginning, please see "perldoc -q 500".
>
>How does one refer to "perldoc -q 500"? Sorry. I have programmed in octal

perldoc is _the_ standard reference for any Perl command, function,
tool, module, you name it. It is automatically installed as part of any
(correctly) installed Perl installation and you just call it.

Use
perldoc perldoc
to find out more about the program itself and
perldoc perl
for a top level overview of what information is available. Some helpful
option are
perltoc: display table of content
-q : search the FAQ
-f : display the documentation of a specific function
ModuleName: display the documentation for module ModuleName
perlop: display list and documentation of all operators in Perl
perlsyn: syntax definition for Perl

There are numerous other documents available, like a reference tutorial,
reference documentation, several OO manuals, regular expression tutorial
and manual, and and and.

As for "perldoc -q 500" just type that command in at your command line.

> am new to Perl and the book I have been using to learn it, seems to
>disagree with some of the coding I find on the web. It makes it all very
>exasperating.

There are quite a few poorly written books and many, many examples of
really bad code out there. If you really want to know how something is
supposed to work then check out perldoc. It is the ultimate although not
always easiest to read reference. And it is always up to date and always
matching the version of Perl that you installed.

jue