Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: using exit;

by rinceWind (Monsignor)
on Apr 09, 2002 at 10:54 UTC ( [id://157694]=note: print w/replies, xml ) Need Help??


in reply to using exit;

You may well be better off with:
use CGI::Carp qw(fatalsToBrowser);
and using die with a message, which will display a sensible screen on the user's browser.

See also this thread

Replies are listed 'Best First'.
Re: Re: using exit;
by tachyon (Chancellor) on Apr 09, 2002 at 12:29 UTC

    While 'fatalsToBrowser' is great for debugging it should be commented out for production IMHO. The reasons are 1) that it reveals far too much detail to someone who is deliberately hacking your system and 2) does not produce a particularly user friendly message (better than a 500 but not much). I think a die_nice routine (as noted above) is better idea as it lets you kid the user everything is OK while silently logging the problem and/or sending you an email to fix it.

    cheers

    tachyon

    s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

      I disagree to this blanket statement. We use fatalsToBrowser (with a custom message), but we're just very particular about where we let the program die. I can list off all of the die calls for our entire application off the top of my head -- and they're all severe enough to warrant something evil. Die() is reserved for Should Never Happen errors.

      So if *we* didn't call die, then Perl must have bailed. Modules I have wrapped in eval {} because I don't want them dying -- ever. (XML::Parser--) This pretty much just leaves compilation errors and if we've put a program onto production that won't compile then we've got much more serious issues than the user seeing an ugly message.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://157694]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-24 11:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found