title: How to know status of process started with Win32::Job
body: <p>I have the following to start a process with a timeout</p>
  
  <pre><code>use Win32::Job;
  my $job = Win32::Job-&gt;new;
  
  # Run $command for $max_time
  $job-&gt;spawn($Config{"C:/Windows/System32/cmd.exe"}, $command, new_group);
  $job-&gt;run($max_time);
  $job_stat=$job-&gt;status;
  print LOG "$command status $job_stat\n";   
  </code></pre>
  
  <p>I read the <a href="https://metacpan.org/module/Win32%3a%3aJob" rel="nofollow"><code>Win32::Job</code></a> CPAN guide and added the last two lines because I would like to know whether the process ran to completion or was timed out. Is this the correct way to do this? </p>