http://www.perlmonks.org?node_id=1012104


in reply to capture STDOUT when some jerk opened STDOUT to /dev/tty

Being just a clueless newbie, I'd create a simple module (call it MyOpen) that overrides CORE::open. Upon encountering a '/dev/tty' it can then substitute '/dev/null' or something more appropriate before calling CORE::open. Pack this into the invoking system / backticks using -MMyOpen. or set PERL5OPT.

  • Comment on Re: capture STDOUT when some jerk opened STDOUT to /dev/tty