我想将die消息重定向到一个单独的文件,以便我可以稍后比较该文件以确定出错的地方.
$cat test.pl use strict; use warnings; my $log = "msglog.log"; die $log "DEAD$!"; $perl test.pl Missing comma after first argument to die function at test.pl line 5,near ""DEAD$!";" Execution of test.pl aborted due to compilation errors. $
我不想做2>来自来电者.有没有办法从脚本中重定向它们?