What if you redirect stdout to a temp file and then launch a separate perl program whose only job is to monitor this temp file and see if it changes. And if it does change, it reads the last 25 lines from the file and prints it to this terminal window. That way whatever gets written to stdout will be displayed in the terminal window.