in reply to Re^2: simple timeout
in thread simple timeout
use Win32::Process; ... ... my $pID; foreach (servers) { ... ... Win32::Process::Create ($pObj, Win32::OLE->GetObj..., ....); $pID = $pObj->GetProcessID(); $pObj->Wait(5000) # 5 secs // it's either been 5 secs or $pObj finished if ($pID is there) { then it's been 5secs cleanup and restart your loop } else { $pObj finished? } }
|
---|