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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.