Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: capture error executing a binary

by Xaositect (Friar)
on Jun 09, 2005 at 21:42 UTC ( [id://465333]=note: print w/replies, xml ) Need Help??


in reply to capture error executing a binary

I don't know for sure if the behaviour with a segfault will change this, but I don't know why it would:
The standard way to handle unsafe code in perl is using an eval block, and then checking the error variable, like:

eval { system('somebinary'); }; print STDERR "Arrgh!: $@\n" if ($@);

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-04-24 01:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found