我STDOUT
在 Perl 脚本中进行了重定向。我在模块中打印的所有内容都被重定向到一个文件。有没有办法STDOUT
在 Perl 模块中恢复?
这是我的例子
require my_module;
open(STDOUT, ">$outlog") || die "Error stdout: $!";
open(STDERR, ">>$outlog") || die "Error stderr: $!";
my_module::my_func();
所以我想STDOUT
在my_module::my_func()
函数中打印一条消息并退出。