我有:
我的.perlcriticrc文件:
severity = 1
only= 1
[CodeLayout::ProhibitHardTabs]
allow_leading_tabs = 0
[Perl::Critic::Policy::CodeLayout::RequireConsistentNewlines]
[Perl::Critic::Policy::Tics::ProhibitLongLines]
base_max = 120
hard_max = 130
pct_allowed = 5
[Perl::Critic::Policy::OTRS::RequireCamelCase]
其他策略按预期运行,但每当一行超过hard_max定义的长度时,我收到错误消息:
Use of uninitialized value $min_width in numeric gt (>) at /home/birdy/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/String/Format.pm line 51.
Use of uninitialized value $replength in numeric gt (>) at /home/birdy/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/String/Format.pm line 51.
Use of uninitialized value $max_width in numeric gt (>) at /home/birdy/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/String/Format.pm line 56.
Use of uninitialized value $replength in numeric gt (>) at /home/birdy/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/String/Format.pm line 56.
Use of uninitialized value $replength in subtraction (-) at /home/birdy/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/String/Format.pm line 67.
Use of uninitialized value $min_width in subtraction (-) at /home/birdy/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/String/Format.pm line 67.
Use of uninitialized value $replacement in concatenation (.) or string at /home/birdy/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/String/Format.pm line 67.
感谢您的时间,如果您需要任何其他信息,请与我们联系。
答案 0 :(得分:1)
这对我来说似乎是个错误。即使我完全忽略了我的.perlcriticrc
文件,我也会收到相同的警告:
perlcritic -1 --noprofile mycode.pl
我在perl 5.12.2。
您应该submit a bug report反对Perl::Critic::Tics。我已检查Changes
和Perl::Critic的Tics
个文件,但我找不到与String::Format
相关的任何内容。确保您拥有最新版本的Critic
和Tics
。我有当前Tics
(0.006),但我的Critic
有点过时(1.111)。