In general, it's poor form for a module to call die or warn. Take a look at the Carp module (part of the standard distribution) and use either Carp::croak or Carp::carp.
HTH
| [reply] [d/l] [select] |
| [reply] |
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). | [reply] |
Thank you for such quick responses. Upon reviewing y'alls hints
and the Carp man page I determined that croaking on module init
and carping on the other errors made sense. Thanks for such
good responses.
AM | [reply] |