我試圖運行其手冊頁中描述的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