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

How do I make a system() exit on control-C?

by faq_monk (Initiate)
on Oct 08, 1999 at 00:29 UTC ( #748=perlfaq nodetype: print w/ replies, xml ) Need Help??

Current Perl documentation can be found at

Here is our local, out-dated (pre-5.6) version:

You can't. You need to imitate the system() call (see the perlipc manpage for sample code) and then have a signal handler for the INT signal that passes the signal on to the subprocess. Or you can check for it:

    $rc = system($cmd);
    if ($rc & 127) { die "signal death" } 

Log In?

What's my password?
Create A New User
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2015-10-07 03:45 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (170 votes), past polls