my $child_PID = fork; if ($child_PID == 0) { # We're in the child process, so redirect I/O handles and run program... close STDOUT; open STDOUT, '>', 'foobar.log' or die $!; exec 'foobar.exe', 'argument_1', 'second argument', 'etc...'; die "Couldn't find foobar.exe!"; # should never get here... } else { # We're in the parent, so wait a few seconds, and kill the child. sleep 10; kill 9, $child_PID; }