我试图运行其手册页中描述的fping脚本。fping脚本中描述的脚本有语法错误
#!/usr/local/bin/perl
require 'open2.pl';
$MAILTO = "root";
$pid = &open2("OUTPUT","INPUT","/usr/local/bin/fping -u");
@check=("slapshot","foo","foobar");
foreach(@check) { print INPUT "$_\n"; }
close(INPUT);
@output=;
if ($#output != -1) {
chop($date=`date`);
open(MAIL,"|mail -s 'unreachable systems' $MAILTO");
print MAIL "\nThe following systems are unreachable as of: $date\n\n";
print MAIL @output;
close MAIL;
}
不过,我从任何地方得到下面的错误我运行它:
syntax error at /path/to/pingtest.pl line 13, near "=;" Execution of /path/to/pingtest.pl aborted due to compilation errors.
有人可以帮助我有什么错线13?我有open2.pl和fping路径是正确的。
请链接到你的来源,当您有外部性问题是非常有用的信息 – Borodin