in reply to Synchronizing STDERR and STDOUT

What version of Windows are you running on? On Windows XP Professional I can do the following:
use strict; my $cmd = 'perl -e "die( q[report this error] )" 2>&1'; if ( ! open( FIN, "$cmd |" ) ) { die( "Could not run $cmd: $!" ); } my $input = join( '', <FIN> ); close( FIN ); print( "My input was:\n$input\n--end--\n" );
which outputs the following:
C:\temp>perl -w perlwinredirect.pl My input was: report this error at -e line 1. --end--

Replies are listed 'Best First'.
Re^2: Synchronizing STDERR and STDOUT
by Ovid (Cardinal) on Sep 21, 2006 at 11:13 UTC

    There's no particular version of Windows. This is for TAPx::Parser which, hopefully, will run anywhere that Perl can run. Thus, I can't rely on any particular version of Windows. Hence my need to keep this as portable as possible.

    Cheers,
    Ovid

    New address of my CGI Course.