Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Setting $! in xs

by Prof Vince (Friar)
on Aug 06, 2011 at 20:48 UTC ( #918997=note: print w/ replies, xml ) Need Help??


in reply to Setting $! in xs

Just assign to errno in your C code. $! is magic, so it will be automatically updated the next time it is evaluated in Perl.

But you should do that only if the error code you want to pass this way is a meaningful errno code (for example, if it is given after a system call). For all the other cases, an exception is a much saner solution.


Comment on Re: Setting $! in xs

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2015-05-23 05:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    In my home, the TV remote control is ...









    Results (465 votes), past polls