OK, as usual I'm not expressing myself clearly :) Let's say Data::Sah is just an example. So the performance of s///r, or which version of Perl is most widespread, or which version of Perl to target to to be safe, or Perl::MinimumVersion, all that is red herring.

What I'm really trying to point out is whether Perl should expose the user's intent of 'use VERSION' to Perl code. And I'm arguing that it should. We can already get version information when user says 'use MODULE VERSION', so why not the case with 'use VERSION'? Aside from my Data::Sah example, I can think of a couple more use-cases where finding out VERSION in 'use VERSION' can be useful:

1) code analysis -- checking whether user's statement of 'use VERSION' is justified. Here we can use Perl::MinimumVersion to compare what user says she needs and what Perl features she actually uses.

2) policy enforcement -- we are running some later version of Perl on some servers (say 5.18) but are also running earlier versions (say 5.14), we want to make sure that all code runs under the minimum version and no code says 'use 5.016' or 'use 5.018'. This is of course can also be done using testing/CI, but if Perl can give version information in 'use VERSION', we can also fail on 5.18 test machines.


In reply to Re^4: Exposing minimum required perl version ('use x.y.z') to Perl code during runtime? by sedusedan
in thread Exposing minimum required perl version ('use x.y.z') to Perl code during runtime? by sedusedan

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.