|P is for Practical|
Friendly error trappingby bradcathey (Prior)
|on Sep 13, 2005 at 00:15 UTC||Need Help??|
bradcathey has asked for the wisdom of the Perl Monks concerning the following question:
I know that the Perlish way to handle an errors, like writing to a file, is to die, print the error $!, and take the forced exit. However, because I am writing commercial end-user web apps, I can't just exit—I need to put the best face on the error and keep the program going. In review, this is what I was taught:
However, this is basically what I have been doing instead:
Is it "safe" or "good practice" not to die? Or is there some intrinsic value of die that I am missing by not using it? Thanks all!
"The important work of moving the world forward does not wait to be done by perfect men." George Eliot