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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://918997]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (None)
    As of 2017-08-19 03:28 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      Who is your favorite scientist and why?



























      Results (310 votes). Check out past polls.

      Notices?