有一个简单的模块
package Rrr;
use 5.014;
use warnings;
use namespace::sweep;
use Moo;
use Method::Signatures::Simple;
BEGIN {
our $VERSION = '0.0.1';
}
has 'root' => (
is => 'rw',
default => 'root'
);
method func {
say 'This is the func method from ' . __PACKAGE__ . ' with value: ', $self->root;
}
1;
perlcritic -1
说_
Code is not tidy at line 1, column 1. See page 33 of PBP. (Severity: 1)
Module does not end with "1;" at line 17, column 1. Must end with a recognizable true value. (Severity: 4)
Return value of flagged function ignored - say at line 18, column 5. See pages 208,278 of PBP. (Severity: 1)
如何让批评家开心?
编辑 - 基于@toolic 的评论
是的,整洁有助于解决第一个问题(但Code is not tidy at line 1, column 1.
没有太大帮助的消息),因为差异是:
13c13
< is => 'rw',
---
> is => 'rw',
18c18,19
< say 'This is the func method from ' . __PACKAGE__ . ' with value: ', $self->root;
---
> say 'This is the func method from ' . __PACKAGE__ . ' with value: ',
> $self->root;
但还是得到了:
Module does not end with "1;" at line 17, column 1. Must end with a recognizable true value. (Severity: 4)
Return value of flagged function ignored - say at line 18, column 5. See pages 208,278 of PBP. (Severity: 1)
我的批评家:
$ perlcritic --version
1.125