2012-02-10 72 views
3

我:不能得到政策的Perl ::評論家::策略::抽搐:: ProhibitLongLines工作

  • 的Ubuntu 10.04
  • Perlbrew 0.39
  • 切換到使用Perl 5.12.3。與perlbrew
  • 安裝的perl ::評論家和Perl ::評論家::與cpanm抽動

我.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 definded長度,我得到的錯誤信息:

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. 

感謝您的時間,如果你需要任何額外的信息,讓我知道。

回答

1

這對我來說似乎是一個錯誤。我得到同樣的警告,即使我完全忽略了我的.perlcriticrc文件:

perlcritic -1 --noprofile mycode.pl 

我Perl的5.12.2。

你應該submit a bug reportPerl::Critic::Tics。我檢查了TicsPerl::CriticChanges文件,但我沒有發現與String::Format有關的任何內容。確保你有最新版本的CriticTics。我目前有Tics(0.006),但我的Critic有點過時(1.111)。

+1

我有Tics(0.006)和Perl :: Critic(1.117)。我提交了一個報告:https://rt.cpan.org/Public/Bug/Display.html?id=74896 – Birdy 2012-02-12 17:16:13

+1

我在openSUSE 12.1中遇到了同樣的錯誤,所以我想這是一個錯誤。我會upvote你的答案,但我需要15個聲望點。感謝您的時間工具。 – Birdy 2012-02-12 17:24:33

+0

不客氣。祝你好運。 – toolic 2012-02-12 20:50:50