Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
嗨,我需要在两个文件中都有 perl 脚本的输出,STDOUT但我不能像./a.pl > out.log. 可能吗?
STDOUT
./a.pl > out.log
显然,你应该使用
./a.pl | tee out.log
但听起来你会拒绝。下一个最好的可能是File::Tee。
use File::Tee qw( tee ); tee(STDOUT, '>', 'out.log');
试试这个:
a.pl | tee out.log