It's the shell in either environment that provides for the command line redirection syntax (2>&1). When you use backticks, the shell is bypassed unless you explicitly state it.
Something along these lines might work.
my $shell = $^O eq 'MSWin32' ? "$ENV{comspec} /c " : "$ENV{shell} /?"; ## Bad guess my @output = `$shell java yourprog 2>&1`;
In reply to Re: Program arg interfering with redirecting STDERR to STDOUT
by BrowserUk
in thread Program arg interfering with redirecting STDERR to STDOUT
by need_help
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |