http://qs1969.pair.com?node_id=491438


in reply to Re: Friendly error trapping
in thread Friendly error trapping

My question was simply this: is there something internal that die does that is necessary to exit a script properly?

The very point of this is to provide a more detailed error message, such as you describe, so the user does indeed know what the problem is without ungraciously dumping them in the middle of nowhere.

Update: To clarify, almost 100% of the time, this scenario is usually part of processing an HTML form which is uploading something or performing some file op, such as deleting a file. If there is an error, I use HTML::Template and HTML::FillInForm to re-display the form with the error message at the top so they can try again (or at least know what happened).


—Brad
"The important work of moving the world forward does not wait to be done by perfect men." George Eliot