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__