On Wed, 14 Sep 2005, Anthony Okusanya wrote: > Hi All I am changing one of my script from using system($command) to > using the > Win32::Process::Create($obj,$appname,$cmdline,$iflags,$cflags,$curdir) > method. The problem I have is I want to be able to tell if this > process is still running. e.g > > While($obj still running) > { > do a few things > } > I cant find a method to check the status of the process.
You can use the fact that there is no exit code available while the process is still running. Try something like this sub STILL_ACTIVE () { 259 } # ... setup your $obj ... while () { $obj->GetExitCode(my $exit); last unless $exit == STILL_ACTIVE; # ... do a few things ... } The next version of Win32::Process will define (and optionally export) the STILL_ACTIVE constant, but for now you need to define it yourself. Cheers, -Jan _______________________________________________ ActivePerl mailing list ActivePerl@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs