|
From: Dave C. <da...@da...> - 2001-11-13 21:13:33
|
On Tue, Nov 13, 2001 at 07:15:15PM +0000, Jonathan Stowe (gel...@ge...) wrote:
[on CGI::Carp]
> I've got a better idea:
>
> use CGI::Carp qw(fatalsToBrowser set_message);
>
> use vars qw($DEBUGGING);
>
> BEGIN
> {
> $DEBUGGING = 1;
>
> $error_handler = sub
> {
> my ($mesg) = @_;
> print "text/html\n\n";
> print "<strong>Something nasty happened</strong>";
>
> print "Perl said : $message" if $DEBUGGING;
> }
>
> set_message($error_handler);
> }
>
> I'm not sure when that feature came about :)
This is important to know. I've made the (arbitrary) decision that nms
scripts should work under standard Perl 5.004_04. If we insist on anything
later we'll alienate a large part of our potential audience. I still run
web sites on hosted servers that run 5.004_04!
> Then you get the best of both worlds :) It has to be borne in mind that
> someone installing the application and configuring it is likely to find
> themselves debugging their install environment - it would be nice to be
> able to tell them to just alter the $DEBUGGING variable to display
> suitable diagnostics - not that I'm subscribed to the support list ;-}
I certainly like this way of doing things. If it works under our target
version then I'll be more than happy to use it.
I'll see if I can find out which version of CGI and CGI::Carp shipped with
Perl 5.004_04.
Dave...
--
Don't dream it... be it
|