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


in reply to Unable to redirect stderr to stdout

try with system()

perl -e 'my $result = system("ls 2>&1"); print $result;'

But this should be ok, also. There is something here that we don't know

perl -e 'my $result = `ls -3 2>&1`; print $result;' perl -e '`ls -3 2>&1`;' # <-- please note that this other one is silen +t