in reply to Using Win32::Process to prevent timeouts
I'm not sure what exactly you want to do, but Win32::Process is basically going to launch another application from your script. Here's what I did to launch a perl one-liner to test whether or not the connection attempt would hang.
Hope that's helpful,sub RegConnect { my ($pObj, $ExitCode); my $comp = shift; my $pString = "perl -MWin32::TieRegistry -e " . '"' . '$Registry->Connect(' ."'" . $comp . "', 'LMachine');" . '"'; Win32::Process::Create($pObj, "c:\\perl\\bin\\perl.exe", $pString, 0, NORMAL_PRIORITY_CLASS, ".")|| die "Can't create Perl Process: $!\n"; $pObj->Wait(7000); $pObj->GetExitCode($ExitCode); if ($ExitCode) { $pObj->Kill(1); return 0; } return 1; }
|
---|
Replies are listed 'Best First'. | |
---|---|
(tye)Re: Using Win32::Process to prevent timeouts
by tye (Sage) on Feb 05, 2002 at 06:23 UTC | |
by rchiav (Deacon) on Feb 05, 2002 at 13:04 UTC | |
Re: Re: Using Win32::Process to prevent timeouts
by fullyloaded (Initiate) on Feb 05, 2002 at 11:15 UTC | |
by rchiav (Deacon) on Feb 05, 2002 at 14:16 UTC |