in reply to execute a file, then send terminate command?
use IO::Handle; STDOUT->autoflush; [download]
UPDATE: ignore my comments .. I read the question incorrectly