|Welcome to the Monastery|
capture STDOUT when some jerk opened STDOUT to /dev/ttyby Tommy (Chaplain)
|on Jan 07, 2013 at 17:22 UTC||Need Help??|
Tommy has asked for the
wisdom of the Perl Monks concerning the following question:
I have to capture STDOUT from a perl script created by someone long since gone at $work. This individual decided to open( STDOUT, ">/dev/tty" ), so no matter what I do, output goes to my terminal. I've tried subshells, su - -c, Perl wrappers with IPC::Open3...
I'm not allowed to touch the script. That's completely forbidden.
Is there some way to capture the output and get it to stop spewing its text to my terminal? I'm concurrently looking for ways to send the terminal's STDOUT somewhere else...
"Perl follows the principle of least astonishment"