I just stumbled upon a fun, new recipie for carp
It's a module (CGI::Carp::DebugScreen). Seems to add some potentially very useful additions -- almost a kind of Carp Blog. Enough of the nonsense. This looked like it might useful, so I thought I'd share my findings with you all.
From it's page on CPAN:
CGI::Carp qw/fatalsToBrowser/ is very useful for debugging. But the error screen it provides is a bit too plain; something you don't want to see, and you don't want your boss and colleagues and users to see. You might know CGI::Carp has a wonderful set_message() function but, you don't want to repeat yourself, right?Hence this module.
This module calls CGI::Carp qw/fatalsToBrowser/ and set_message() function internally. If something dies or croaks, this confesses stack traces, included modules (optional), environmental variables (optional, too) in a more decent way.
When you finish debugging, set debug option to false (via some environmental variable, for example). Then, more limited, less informative error screen appears with dies or croaks. If something goes wrong and your users might see the screen, they only know something has happened. They'll never know where your modules are and they'll never see the awkward 500 Internal Server Error -- hopefully.
You can, and are suggested to, customize both debug and error screens, and some style settings, in harmony with your application.
So what do you think? Let me know.
--Chris
#!/usr/bin/perl -Tw use Perl::Always or die; my $perl_version = (5.12.5); print $perl_version;
In reply to Carp; fresh water fish -- a delicious new recipie by taint
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |