leonidlm has asked for the wisdom of the Perl Monks concerning the following question:
My problem is that if in one iteration the timeout really worked the process run by qx is still will be running in the background! Is there a way of killing this process too right after the eval will finish?eval { local $SIG{ALRM} = sub {die "Cant get node's time ($host)\n"}; alarm 5; @out = qx {$cmd}; if ($out[1] !~ /OVO Managed Node status :/) { print "Detected error for node $host\n"; } alarm 0; };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: eval leaving processess behind
by ikegami (Patriarch) on Nov 09, 2008 at 17:07 UTC | |
by leonidlm (Pilgrim) on Nov 09, 2008 at 21:10 UTC | |
by ikegami (Patriarch) on Nov 09, 2008 at 21:27 UTC | |
by leonidlm (Pilgrim) on Nov 09, 2008 at 21:51 UTC |