I would like to send the output from a command to both STDOUT and to a variable. I want to combine:
my $var = `some command` ; system( \'some command\' )
Perhaps my answer here can help you: How can I hook into Perl’s print?
Send the output from the Tee module to /dev/stdout (or /dev/fd/1).
/dev/stdout
/dev/fd/1