good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: Errors in Module - What to do with them.by runrig (Abbot) |
on Sep 26, 2001 at 23:45 UTC ( [id://114921]=note: print w/replies, xml ) | Need Help?? |
Some would say it depends on how fatal the error should be.
If you die, and document that that's what happens, you can let the caller deal with it with an 'eval' if he likes, and the error message will be in $@. If there's an error message to report, I usually prefer that to returning undef and putting the error message in some package variable (at least lately).
In Section
Seekers of Perl Wisdom
|
|