当我尝试运行包含以下代码的脚本时出现错误。 错误是Fingerprint.pm第131行的语法错误,靠近“{” [类似于下面的8]。我对perl没有经验,我在这里错过了什么吗?
my @ruleset = (
{ fingerprint=>$iq[0], header=>$qy[0], query=>$ntc[0], ruleset => [
{ fingerprint=>$iq[1], header=>$qy[1], query=>$ntc[1], ruleset => [
{ fingerprint=>$iq[2], header=>$qy[2], query=>$ntc[2], ruleset => [
{ fingerprint => $iq[2], result => { vendor =>"VENDOR", product=>"BIND 9.2.2-P3",version=>"VERSION"}, }
{ fingerprint => $iq[1], result => { vendor =>"VENDOR", product=>"BIND 9.2.0", version=>"VERSION"}, #This is line 131, the error line
}]},
{ fingerprint => $iq[3], result => { vendor =>"VENDOR", product=>"BIND 9.2.1",version=>"VERSION"}, }
]},
{ fingerprint => $iq[4], result => { vendor =>"VENDOR", product=>"BIND 9.2.0rc3",version=>"VERSION"}, }
]},
{ fingerprint=>$iq[5], header=>$qy[0], query=>$ntc[0], ruleset => [
{ fingerprint=>$iq[2], header=>$qy[2], query=>$ntc[2], ruleset => [
{ fingerprint => $iq[2], result => { vendor =>"VENDOR", product=>"BIND 9.1.2",version=>"VERSION"}, }
{ fingerprint => $iq[1], result => { vendor =>"VENDOR", product=>"BIND 9.1.1",version=>"VERSION"}, }
]},
{ fingerprint => $iq[6], result => { vendor =>"VENDOR", product=>"BIND 9.1.3",version=>"VERSION"}, }
]},
{ fingerprint=>$iq[7], header=>$qy[0], query=>$ntc[0], ruleset => [
{ fingerprint=>$iq[8], header=>$qy[3], query=>$ntc[3], ruleset => [
{ fingerprint=>$iq[9], header=>$qy[2], query=>$ntc[2], ruleset => [
{ fingerprint=>$iq[1], header=>$qy[4], query=>$ntc[4], ruleset => [
{ fingerprint=>$iq[1], header=>$qy[5], query=>$ntc[5], ruleset => [
{ fingerprint => $iq[2], result => { vendor =>"VENDOR", product=>"BIND 9.2.5",version=>"VERSION"}, }
{ fingerprint => $iq[1], result => { vendor =>"VENDOR", product=>"BIND 9.2.6",version=>"VERSION"}, }
]},
{ fingerprint => $iq[2], result => { vendor =>"VENDOR", product=>"BIND 9.2.9",version=>"VERSION"}, }
]},
{ fingerprint => $iq[2], result => { vendor =>"VENDOR", product=>"BIND 9.2.4",version=>"VERSION"}, }
]},
{ fingerprint => $iq[2], result => { vendor =>"VENDOR", product=>"BIND 9.2.7",version=>"VERSION"}, }
{ fingerprint => $iq[3], result => { vendor =>"VENDOR", product=>"BIND 9.2.8",version=>"VERSION"}, }
]},
{ fingerprint=>$iq[10], header=>$qy[3], query=>$ntc[3], ruleset => [
{ fingerprint=>$iq[11], header=>$qy[6], query=>$ntc[6], ruleset => [
{ fingerprint=>$iq[12], header=>$qy[1], query=>$ntc[1], ruleset => [
{ fingerprint=>$iq[13], header=>$qy[7], query=>$ntc[7], ruleset => [
{ fingerprint => $iq[14], result => { vendor =>"VENDOR", product=>"BIND 9.4.1",version=>"VERSION"}, }
{ fingerprint => $iq[15], result => { vendor =>"VENDOR", product=>"BIND 9.4.2",version=>"VERSION"}, }
]},
{ fingerprint=>$iq[16], header=>$qy[7], query=>$ntc[7], ruleset => [
{ fingerprint=>$iq[17], header=>$qy[8], query=>$ntc[8], ruleset => [
{ fingerprint=>$iq[15], header=>$qy[9], query=>$ntc[9], ruleset => [
{ fingerprint => $iq[9], result => { vendor =>"VENDOR", product=>"BIND 9.6.0",version=>"VERSION"}, }
{ fingerprint => $iq[18], result => { vendor =>"VENDOR", product=>"BIND 9.4.0, BIND 9.4.0b4, BIND 9.4.3, BIND 9.5.0, BIND 9.5.1, ",version=>"VERSION"}, }
]},
{ fingerprint => $iq[2], result => { vendor =>"VENDOR", product=>"BIND 9.4.0a5",version=>"VERSION"}, }
]},
{ fingerprint => $iq[19], result => { vendor =>"VENDOR", product=>"BIND 9.5.2, BIND 9.6.1, BIND 9.6.2, BIND 9.7.0, BIND 9.7.1, ",version=>"VERSION"}, }
]},
]},
{ fingerprint=>$iq[1], header=>$qy[1], query=>$ntc[1], ruleset => [
{ fingerprint=>$iq[1], header=>$qy[4], query=>$ntc[4], ruleset => [
{ fingerprint=>$iq[1], header=>$qy[10], query=>$ntc[10], ruleset => [
{ fingerprint=>$iq[2], header=>$qy[11], query=>$ntc[11], ruleset => [
{ fingerprint => $iq[2], result => { vendor =>"VENDOR", product=>"BIND 9.3.1",version=>"VERSION"}, }
{ fingerprint => $iq[1], result => { vendor =>"VENDOR", product=>"BIND 9.3.3",version=>"VERSION"}, }
]},
{ fingerprint=>$iq[1], header=>$qy[11], query=>$ntc[11], ruleset => [
{ fingerprint=>$iq[1], header=>$qy[12], query=>$ntc[12], ruleset => [
{ fingerprint => $iq[2], result => { vendor =>"VENDOR", product=>"BIND 9.3.5",version=>"VERSION"}, }
{ fingerprint => $iq[1], result => { vendor =>"VENDOR", product=>"BIND 9.3.6-P1, BIND 9.3.6, ",version=>"VERSION"}, }
]},
{ fingerprint => $iq[2], result => { vendor =>"VENDOR", product=>"BIND 9.3.2",version=>"VERSION"}, }
]},
]},
{ fingerprint => $iq[2], result => { vendor =>"VENDOR", product=>"BIND 9.3.0",version=>"VERSION"}, }
]},
{ fingerprint => $iq[2], result => { vendor =>"VENDOR", product=>"BIND 9.3.4",version=>"VERSION"}, }
]},
]},
{ fingerprint => $iq[20], result => { vendor =>"VENDOR", product=>"BIND 9.6.3, BIND 9.7.3, ",version=>"VERSION"}, }
]},
]},
{ fingerprint=>$iq[21], header=>$qy[0], query=>$ntc[0], ruleset => [
{ fingerprint=>$iq[17], header=>$qy[1], query=>$ntc[1], ruleset => [
{ fingerprint=>$iq[22], header=>$qy[13], query=>$ntc[13], ruleset => [
{ fingerprint => $iq[23], result => { vendor =>"VENDOR", product=>"NSD 3.0.0, NSD 3.0.1, NSD 3.0.2, NSD 3.0.3, NSD 3.0.4, NSD 3.0.5, NSD 3.0.6, NSD 3.0.7, NSD 3.0.8, NSD 3.1.0, NSD 3.1.1, NSD 3.2.0, NSD 3.2.1, NSD 3.2.2, NSD 3.2.3, NSD 3.2.4, NSD 3.2.5, NSD 3.2.6, NSD 3.2.7, NSD 3.2.8, ",version=>"VERSION"}, }
{ fingerprint => $iq[19], result => { vendor =>"VENDOR", product=>"NSD 2.1.3, NSD 2.1.4, NSD 2.1.5, NSD 2.2.0, NSD 2.2.1, NSD 2.3.6, NSD 2.3.7, ",version=>"VERSION"}, }
]},
{ fingerprint => $iq[19], result => { vendor =>"VENDOR", product=>"NSD 1.2.0, NSD 1.2.1, NSD 1.2.2, NSD 1.2.3, NSD 1.2.4, ",version=>"VERSION"}, }
]},
{ fingerprint => $iq[24], result => { vendor =>"VENDOR", product=>"NSD 2.0.0, NSD 2.0.1, NSD 2.0.2, NSD 2.1.0, NSD 2.1.1, NSD 2.1.2, NSD 2.3.0, NSD 2.3.1, NSD 2.3.2, NSD 2.3.3, NSD 2.3.4, NSD 2.3.5, ",version=>"VERSION"}, }
]},
{ fingerprint=>$iq[25], header=>$qy[0], query=>$ntc[0], ruleset => [
{ fingerprint => $iq[3], result => { vendor =>"VENDOR", product=>"BIND 9.2.0rc6",version=>"VERSION"}, }
{ fingerprint => $iq[9], result => { vendor =>"VENDOR", product=>"BIND 9.2.2",version=>"VERSION"}, }
]},
{ fingerprint=>$iq[26], header=>$qy[0], query=>$ntc[0], ruleset => [
{ fingerprint=>$iq[1], header=>$qy[14], query=>$ntc[14], ruleset => [
{ fingerprint=>$iq[16], header=>$qy[7], query=>$ntc[7], ruleset => [
{ fingerprint=>$iq[16], header=>$qy[9], query=>$ntc[9], ruleset => [
{ fingerprint=>$iq[2], header=>$qy[15], query=>$ntc[15], ruleset => [
{ fingerprint => $iq[27], result => { vendor =>"VENDOR", product=>"Unbound 1.4.7",version=>"VERSION"}, }
{ fingerprint => $iq[28], result => { vendor =>"VENDOR", product=>"Unbound 1.4.5, Unbound 1.4.6, Unbound 1.4.8, ",version=>"VERSION"}, }
]},
{ fingerprint => $iq[19], result => { vendor =>"VENDOR", product=>"Unbound 1.4.10",version=>"VERSION"}, }
]},
{ fingerprint => $iq[15], result => { vendor =>"VENDOR", product=>"Unbound 1.4.3",version=>"VERSION"}, }
]},
{ fingerprint=>$iq[29], header=>$qy[7], query=>$ntc[7], ruleset => [
{ fingerprint=>$iq[16], header=>$qy[9], query=>$ntc[9], ruleset => [
{ fingerprint => $iq[16], result => { vendor =>"VENDOR", product=>"Unbound 1.3.0",version=>"VERSION"}, }
{ fingerprint => $iq[30], result => { vendor =>"VENDOR", product=>"Unbound 1.3.1, Unbound 1.3.2, Unbound 1.3.3, ",version=>"VERSION"}, }
]},
{ fingerprint=>$iq[15], header=>$qy[9], query=>$ntc[9], ruleset => [
{ fingerprint => $iq[28], result => { vendor =>"VENDOR", product=>"Unbound 1.3.4",version=>"VERSION"}, }
{ fingerprint => $iq[27], result => { vendor =>"VENDOR", product=>"Unbound 1.4.0",version=>"VERSION"}, }
]},
]},
{ fingerprint => $iq[30], result => { vendor =>"VENDOR", product=>"Unbound 1.4.1, Unbound 1.4.4, Unbound 1.4.9, ",version=>"VERSION"}, }
]},
{ fingerprint => $iq[2], result => { vendor =>"VENDOR", product=>"Unbound 1.4.2",version=>"VERSION"}, }
]},
{ fingerprint => $iq[31], result => { vendor =>"VENDOR", product=>"BIND 9.2.3",version=>"VERSION"}, }
);
答案 0 :(得分:2)
在该行的末尾看起来像一个缺少的逗号(在您的示例中为第7行)
答案 1 :(得分:1)
第五行(带有'BIND 9.2.2-P3')最后需要一个逗号。还有更多像这样的线条。最简单的解决方法是在所有以}, }
结尾的行添加逗号。