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


in reply to STDOUT, STDERR sniffer

Or, if you don't mind combining stdout and stderr, you can just do:
$output= `command 2>&1`;
"Even if you are on the right track, you'll get run over if you just sit there." - Will Rogers