Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Perl-Critic CPAN distribution.

Report information
The Basics
Id: 30388
Status: resolved
Priority: 0/
Queue: Perl-Critic

People
Owner: Nobody in particular
Requestors: amir.aharoni [...] mail.huji.ac.il
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.078
Fixed in: (no value)



Subject: ProhibitVersionStrings - too strict in some cases
When there's code such as this: use lib '/usr/lib/perl5/vendor_perl/5.8.0'; perlcritic complains: Version string used at line 8, column 1. Use a real number instead. (Severity: 3) (A complete file with a testcase is attached.) This is a reasonable case, because people who `use lib' probably know what they are doing, and in any case it is not a three part version such as in use 5.8.7; It happens because violates() simply checks for any \d\.\d\.\d in any use element. I am not an expert in the intricacies of PPI, `use' and `require', so i'm not sure how to improve it, but the general idea should be that only these cases of `use' usage should be checked: * use Module VERSION LIST * use Module VERSION * use VERSION The LIST part should probably not be checked for this.
Subject: vtest.pl
#!/usr/bin/perl use strict; use warnings; our $VERSION = '0.1'; use lib '/usr/lib/perl5/vendor_perl/5.8.0'; exit; __END__
I added a test case for this. At the moment, I'm not sure how we'll fix it. Most likely, we'll just tune the regex to match the most likely cases.
Fixed and released in version 1.081_005.