Don't ask to ask, just ask | |
PerlMonks |
Re: How to handle Errors?by dragonchild (Archbishop) |
on Apr 05, 2004 at 16:43 UTC ( [id://342682]=note: print w/replies, xml ) | Need Help?? |
The canonical way to handle errors in Perl is to use die and eval. You throw your errors using die and catch them using the block form of eval. You can even throw objects with die and catch them with eval, for fine-grained handling. There are many examples in the various manuals.
Do NOT use Error, because it can cause memory leaks in a number of situations. ------
Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose
In Section
Seekers of Perl Wisdom
|
|