in reply to Reading from STDOUT after Redirecting it.
<aside>
When capturing output from external tools, I almost always capture STDERR as well.
As was pointed out recently, this is straightforward in recent versions of Perl:
my @output = `$cmd $ip 2>&1`;
Perl strips the trailing redirection and redirects STDERR to STDOUT for you, and places both into the list. I believe this is also the case on Win32. Actually, I think this is the case irrespective of platform...
</aside>
|
|---|