Hi monks,
In a module I need to specify a minimum version of Perl.
I use:
use v5.10;
and Perl::Critic biffs on ValuesAndExpressions::ProhibitVersionStrings with the rather hilarious error message:
Version string used at line 5, column 1. ValuesAndExpressions::ProhibitVersionStrings (Severity: 3) Whenever you `use' or `require' a module, you can specify a minimu +m version requirement. To ensure compatibility with older Perls, thi +s version number should be expressed as a floating-point number. Do +not use v-strings or three-part numbers. The Perl convention for expre +ssing version numbers as floats is: version + (patch level / 1000). use Foo v1.2 qw(foo bar); # not ok use Foo 1.2.03 qw(foo bar); # not ok use Foo 1.00203 qw(foo bar); # ok
Hilarious because I am trying to tell the machine to NOT use an old version of Perl, LOL.
So I use:
use 5.10;
and Perl biffs with:
Perl v5.100.0 required (did you mean v5.10.0?)--this is only v5.16.0, +stopped at /path/to/module.pm line 5.
So I follow Perl's advice and do:
use 5.10.0;
... and P::C biffs again.
Anything to do other than disable the P::C rule?
In reply to use 5.10 and Perl::Critic by 1nickt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |