Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Returning external library status codes from an XS routine

by ikegami (Pope)
on Nov 25, 2008 at 01:20 UTC ( #725743=note: print w/ replies, xml ) Need Help??


in reply to Returning external library status codes from an XS routine

I can't really return the status in $! since it isn't an errno value.

No, but nothing is stopping you from making your own global (package) variable or object attribute. For example, DBI has $DBI::err and $DBI::errstr.

You could throw an exception object, where one method returns an error code and another returns an error string.

You could return an error object that overrides booleanification (false on error), numification (error code) and stringification (error message), but that's probably too magical.


Comment on Re: Returning external library status codes from an XS routine
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://725743]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (10)
As of 2014-09-17 11:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (72 votes), past polls