【发布时间】:2011-04-25 19:15:48
【问题描述】:
我想将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>。有没有办法从脚本中重定向它们?
【问题讨论】: