我想用一种原生方式来解决这个问题......
我有一个perl命令,可以进行调用,有时会直接将文本打印到控制台.
我想要这样的东西:
$text = get_output_from(MagicCommandICan'tChange());
if ($text neq "a specific value") {
print $text;
}
Run Code Online (Sandbox Code Playgroud)
有什么办法吗?
use IO::CaptureOutput qw(capture qxx qxy);
# STDOUT and STDERR separately
capture { noisy_sub(@args) } \$stdout, \$stderr;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1803 次 |
| 最近记录: |