gpt4 book ai didi

perl 打开 : how to forward stderr to stdout?

转载 作者:行者123 更新时间:2023-12-02 05:21:41 25 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
How do you capture stderr, stdout, and the exit code all at once, in Perl?
Capturing the output of STDERR while piping STDOUT to a file

我正在使用以下代码来执行一个流程:

open( my $proch, "-|", $command, @arguments );

不幸的是,我只会读取stdout。但我也想阅读 stderr

Stderr 重定向导致以下错误:

open( my $proch, "2>&1 -|", $command, @arguments );
>>> Unknown open() mode '2>&1 -|' at file.pl line 289

如何将 stderr 转发到 stdout

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com