Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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 drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2026-01-17 01:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (120 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.