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( '', ); 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--