should I call TRYAGAIN: my $exitcode = 0; my $count = 0; Win32::Process::KillProcess($pid, $exitcode); # is the method just issue the kill command here and moving # or is it really waits until the process gets killed? if ($exitCode != 1) { # is this a right check? ++$count; if ($count == 2) { print "Error: Failed Killing: " . $pid; exit; } goto TRYAGAIN }