And I second the idea of not using a return code to signify what failed; I do however condone letting undef indicate that there is an error (that can be inspected some other, appropriate, way) if there's no potential for undef as a valid data return.
| [reply] |
Uh, undef is a return code. I don't think that's any better than saying "79" indicates a failure.
| [reply] |
I said:
a return code to signify what failed;
(emphasis added).
I fully realise that undef is a return code. It does not, however, carry information about what failed and why. The lack of defined return code is my signal to go off and look at my object/class and get the error.
That works for me (and as bryan notes above, is somewhat common in CPAN modules).
Your mileage might vary, as they say ;-)
| [reply] |