title: Kill not killing forked process after sleep in perl
body: <p>there. I'm trying to do the following:</p>
  <ul>
  <li>Fork.</li>
  <li>Launched a desktop application.</li>
  <li>Wait for 2 secs.</li>
  <li>Kill the desktop application.</li>
  </ul>
  <p>This is what I have:</p>
  <pre><code>#!/usr/bin/perl
  
  use utf8;
  use strict;
  use warnings;
  
  my @cmd = ('calc.exe');
  
  my $pid = fork();
  die &quot;fork() failed: $!&quot; unless defined $pid;
  
  if ($pid) {
      system @cmd;    
  }
  
  sleep 2;
  kill 'TERM' =&gt; $pid;
  </code></pre>
  <p>The application is launched correctly but it doesn't kill after the two seconds. I know I missing something, I hope someone can point me to the right direction. Right know I'm testing this code in windows 7 SP1 with perl 5.32.1 bundled with msys2.</p>