|
Posted by Gunnar Hjalmarsson on May 29, 2008, 7:16 pm
Please log in for more thread options 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
|