in reply to Timeout on system command
You can probably* set ALARM, open P,"prog |"; read from P and close. There's lots of documentation and examples in perlipc and perlopentut.
* there seem to be some issues with the safe signal handlers in recent perls. try it out.
Joost.
Update: The executed command will probably not end until it tries to write to its STDOUT, which is bound to the P file-handle in the pseudo-code above. You could try using kill to kill it immediately.
|
|---|