I'd suggest forking off the job and retaining the process ID. Then you can use your signal for the timeout, and kill the child process if it's still executing:
my $SIGINT=2; my $PID=fork("my command"); . . . sub SIGHANDLER { kill $SIGINT, $PID; }
...roboticus
In reply to Re: SIG{ALRM} to help kill external program
by roboticus
in thread SIG{ALRM} to help kill external program
by locked0wn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |