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

former33t has asked for the wisdom of the Perl Monks concerning the following question:

This is a follow up to another post where I was trying to capture output from a linux shell command that sends output to both STDOUT and /dev/tty. I am able to trap the output to STDOUT, but output written directly to /dev/tty is proving more of a challenge. The code starts out like:
my @test = qw( fake -b -v 5); use IPC::Run qw(run);
Then varies between one of the two following lines:
run \@tester, \$in, \$out; run \@tester, '>pty>', \$in, '>pty>', \$out;
The first option does trap STDOUT in $out, but messages written to /dev/tty are sent to the terminal running perl script. The second option also traps STDOUT in $out and my /dev/tty output is not sent to the terminal running the script. It also doesn't show up in $out. Any idea where it is going to and how to retrieve it? Thanks in advance perl monks.