in reply to Re^4: Win32::Job::watch vs. system(1,...)
in thread Win32::Job::watch vs. system(1,...)
Then watch() is not a good fit for your requirements. All you need is something like:
my $job = Win32::Job->new; my $pid = $job->spawn(); while( 1 ) { ## read and process next task sleep 3 while $job->status->{ $pid }{ exitcode } == $STILL_RUNNING + ## 259?? and not -e 'killfile'; $job->kill if $job->status->{ $pid }{ exitcode } == $STILL_RUNNING +; $job = Win32::Job->new; $pid = $job->spawn( ... ) }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Win32::Job::watch vs. system(1,...)
by rovf (Priest) on Sep 28, 2009 at 07:21 UTC | |
by BrowserUk (Patriarch) on Sep 28, 2009 at 10:44 UTC |