I have code that executes an external command, vis:
eval {
local $SIG{ALRM} = sub { die alarm\n };
alarm $TIMEOUT;
$text = `$pre_command$host $post_command` || ( $connectOk = 0 );
alarm 0;
$errStr = $^E;
};
The command hangs for a reason I don't understand (its a PsExec
On Wed, 23 Feb 2011, Robert W Weaver wrote:
Is there a way I can protect my routine from hanging system calls?
alarm() will not interrupt a blocking system call on Windows.
If you want to timeout on subprocesses, then you may want to
look at Win32::Job.
Cheers,
-Jan