8

评论家不接受跟随代码,严重性 4:

return {
    'debug'  => $debug,
    'identifier' => $identifier
};

我收到此错误:

# Perl::Critic found these violations in "filename.pl":
# Comma used to separate statements at line 356, column 3.  See pages 68,71 of PBP.  (Severity: 4)

但是这个代码被接受,没有任何备注:

my $result = {
    'debug' => $debug,
    'identifier' => $identifier
};

return $result; 

使用临时变量写我的回报真的更好,还是批评者检测到Comma used to separate statements我只是在构建和返回一个 hashref 的时间是错误的?

4

1 回答 1

7

我在 1.105 版本中发现了这个错误,它在 1.116 版本中消失了。它被固定在那里之间的某个地方。

更改日志中没有提到该修复,但提到了 PPI 更改。可能是 PPI 错误。

于 2012-02-02T11:32:46.557 回答