# Execute program and put it in the background. system("program > out.txt &"); # Wait for file to be created otherwise this will fail. sleep 3; open(IFILE,") { # Do something with output. print "$_\n"; } close(IFILE);