... # launch the window $pid = fork; unless( $pid ) { `MyGUI.exe`; exit 1; } sleep 10; # long enough for the GUI to launch # here is the kicker: kill 9, $pid; # now continue with my usual testing...