Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: capture error executing a binary

by Xaositect (Friar)
on Jun 09, 2005 at 21:42 UTC ( #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
Node Status?
node history
Node Type: note [id://465333]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2018-11-19 09:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My code is most likely broken because:
















    Results (210 votes). Check out past polls.

    Notices?