Subject: | False positive in CodeLayout::RequireFinalSemicolon |
The following code confuses CodeLayout::RequireFinalSemicolon. It seems to boil down to: an arrayref that contains a hashref that contains a variable.
$ cat -n foo.pl
1 my %foo;
2 my @foo;
3 my $foo;
4 my %bongo = (
5 key => {
6 hrows => [
7 {
8 %foo, other => 'field'
9 }
10 ],
11 hcols => [
12 {
13 %foo
14 }
15 ],
16 arows => [
17 {
18 @foo, other => 'field'
19 }
20 ],
21 acols => [
22 {
23 @foo
24 }
25 ],
26 arows => [
27 {
28 $foo, $foo, other => 'field'
29 }
30 ],
31 acols => [
32 {
33 $foo, $foo
34 }
35 ],
36 },
37 );
$ perlcritic -s CodeLayout::RequireFinalSemicolon foo.pl
foo.pl: Put semicolon ; on last statement in a block.
8: %foo, other => 'field'
foo.pl: Put semicolon ; on last statement in a block.
13: %foo
foo.pl: Put semicolon ; on last statement in a block.
18: @foo, other => 'field'
foo.pl: Put semicolon ; on last statement in a block.
23: @foo
foo.pl: Put semicolon ; on last statement in a block.
28: $foo, $foo, other => 'field'
foo.pl: Put semicolon ; on last statement in a block.
33: $foo, $foo