开发者

Perl syntax error on hash [associative array?]

I get an error when I try to run a script that includes the code below. The error is syntax error at Fingerprint.pm line 131, near "{ " [that would be like 8 below]. I'm not experienced with perl, am I missing something here ?

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"}, }
);


Looks like a missing comma on the end of the line before (that'd be line 7 in your example)


The fifth line (with 'BIND 9.2.2-P3') needs a comma at the end. There are more lines like this. The easiest fix is to add a comma at all lines ending with }, }.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜