Re: Need help with a simple (I think) Perl script
- From: Gunnar Hjalmarsson <noreply@xxxxxxxxx>
- Date: Fri, 30 May 2008 01:16:39 +0200
Bill H wrote:
I have noticed in my few years of reading this
group on a daily basis that a majority (whether large or slim) of the
questions seem to be concerning using perl in a cgi environment, but a
many of the answers to these questions seem to present solutions that
will not work in a cgi environment. For example the simple "die"
statement. If you use that in a cgi and call the perl from a web
browser you will get (or it has at least been my experience, I could
be wrong (and probably am)) a 500 internal server error.
While I agree that questions on programs aimed to run as CGI programs are often and unnecessarily twisted by some regulars, the example you give is not a good one. If you develop a Perl program in a CGI environment, you'd better make it a habit to
use CGI::Carp 'fatalsToBrowser';
It will make the browser display more meaningful error messages.
The other suggestion of installing this or using that module, not
everyone who is programming in perl for cgi has their own server or
has the ability of adding new modules to the server (fortunatly I do)
and have to work within the capabilities of the system they are
running on. So if they post a problem and there is a solution that
wouldn't require them installing a module, recommend it, instead of
just saying use blah::blah.
Sometimes when people say "can't" install this or that module, they actually mean "don't know how to". For instance, I have never heard of a situation when a pure Perl module can't be installed, in one way or another. So encouraging people to learn how to make use of modules is usually the right thing to do.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
.
- Follow-Ups:
- Re: Need help with a simple (I think) Perl script
- From: Ben Bullock
- Re: Need help with a simple (I think) Perl script
- From: Bill H
- Re: Need help with a simple (I think) Perl script
- From: szr
- Re: Need help with a simple (I think) Perl script
- References:
- Need help with a simple (I think) Perl script
- From: *** Sutton
- Re: Need help with a simple (I think) Perl script
- From: A. Sinan Unur
- Re: Need help with a simple (I think) Perl script
- From: *** Sutton
- Re: Need help with a simple (I think) Perl script
- From: Lawrence Statton
- Re: Need help with a simple (I think) Perl script
- From: Ted Zlatanov
- Re: Need help with a simple (I think) Perl script
- From: A. Sinan Unur
- Re: Need help with a simple (I think) Perl script
- From: Ben Bullock
- Re: Need help with a simple (I think) Perl script
- From: Bill H
- Need help with a simple (I think) Perl script
- Prev by Date: Re: How to make input user and password in perl script started on web?
- Next by Date: Re: Remove a tab with backspace?
- Previous by thread: Re: Need help with a simple (I think) Perl script
- Next by thread: Re: Need help with a simple (I think) Perl script
- Index(es):