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" );
C:\temp>perl -w perlwinredirect.pl My input was: report this error at -e line 1. --end--
In reply to Re: Synchronizing STDERR and STDOUT
by monarch
in thread Synchronizing STDERR and STDOUT
by Ovid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |