## Start the program asynchronously my $pid = system 1, "padprog.exe"; ## Wait for some period sleep $timeout; ## If program is still running, kill it kill 1, $pid if kill 0, $pid;