----- Original Message ----- From: "Williams, Jeff" <[EMAIL PROTECTED]> To: "'Sisyphus'" <[EMAIL PROTECTED]>; "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]> Sent: Thursday, February 27, 2003 3:55 AM Subject: RE: Win32::Job
> I seem to be having success using sleep, but, as you said- it isn't pretty. > Oh well- TIMTOWTDI. > > Win32::Job is part of libwin32-0.191 on CPAN. There's some pretty cool > stuff in it, but the docs are not great for a newb like me. :) > If you have the source distro you could take a look at 'test.pl' in the 'Job' directory. There's a little bit of code that might help. Looks to me that if this module is going to do what you want then something like the following should do the trick: use Win32::Job; $timeout = # the current value you're using in sleep(); $job = Win32::Job->new; $job->spawn("cmd", q{cmd /C "\\path_to\\parent_app.exe"}); $ok = $job->run($timeout); if($ok) {print "All processes completed"} else {print "Some processes still running"} # code to process the logs If I've got it right that would wait until both child apps have finished running, or until the timeout is reached - whichever happens first. Best to check if it does in fact wait for the child apps to finish - I could be wrong about that. This module works only on 2k or XP (according to the docs). Cheers, Rob _______________________________________________ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs