eval is exactly equivalent to the concept of catching exceptions in other (more pompous ;-) languages. What the OP is talking about is returning an exception object in $@ instead of just an error message. This object can then be inspected, modified and rethrown, or what have you, which gives a bit more flexibility in your error handling. Since this seems to be pretty much what the OP is after, I'd say yeah, exceptions are probably the way forward for this module.
| [reply] [Watch: Dir/Any] [d/l] |
I understand that. It's a matter of how complex he wants to make it for those that write the extensions. They can die with a string or with a blessed object. The advantage to the object approach is that he can also manage the "just how serious is this error" question, as well.
True exception handling is one thing I like about other (more pompous) languages. Sometimes I really miss it in Perl...
| [reply] [Watch: Dir/Any] |