perlquestion pfaut <p>I'm writing an XS interface to a library
and could use some advice on how to return error
information.</p> <p>The routines in the library return 0 if the
call succeeded or a status value if there was an error. The
library contains a routine to convert the status codes into
strings that can be displayed for a user.</p> <p>My interface
routines mostly collect the information into a hash and return a
reference to the caller. In case of error I'm returning an empty
list. I would like to make the error information available to
the caller because it could be very meaningful in certain cases
(e.g., 'end of file' vs. other I/O error conditions).</p> <p>I
can't really return the status in <c>$!</c> since it isn't an
errno value. I can return the error text in <c>$@</c> but then
the programmer would have to parse the error text rather than
acting on an error code.</p> <p>I'm contemplating replacing my
simple handle object with a structure that can contain the
handle and the last status returned by