Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Propagating errors in C code to Perl

by betterworld (Curate)
on Sep 05, 2008 at 13:42 UTC ( [id://709273]=note: print w/replies, xml ) Need Help??


in reply to Propagating errors in C code to Perl

Afaik you can die from C code using the "croak" function. Here's an example how to do it and set $@. Probably setting $! works similar (Update:) by setting errno (see Joost's post).

If you throw exceptions from C code, you just have to make sure that all your dynamically allocated memory is freed, which can be a problem in callbacks from external libraries.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-04-25 07:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found