Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I've heard the argument that it allows you to switch off features introduced in the latest version but shouldn't it be done the other way round, ie. specify if you want limitations, not to enable what is available by default?
Neither is true.

First, use 5.XXX; has always had the meaning "your perl binary needs to be at least 5.XXX for the program to run". This could be because the program uses features not available before, or because a bug-fix essential for the correctness of the program happened in 5.XXX.

Now, since 5.10, use 5.010; also enables some of the new features of 5.10. Most of them you get regardless, whether you have an explicite use 5.010; or not. But a few features have the potential to clash with existing code; say is best known example. The alternative, a policy that's followed up to 5.10 is to not make say part of the language.

Since 5.12, use 5.012; could also introduce changes in behaviour. I'm not too fond of that - it means that if you take a program that has use 5.012;, and remove it or change it to say, use 5.010;, you don't get compilation errors (what you typically would get if do say "foo" and remove the use 5.010; statement), or even runtime errors. Your program just misbehaves - and it'll be hard to debug.

And don't say "don't do that". People have slapped on a use 5.XXX for too high versions. I've made 5.8 modules work on 5.6 by just removing the use 5.008;, and even further back by removing use 5.006; to get them working on 5.005. It was always safe to try - you'd get a compilation error if the use 5.006; or use 5.008; was indeed needed.

Perl never has used use 5.XXX; to impose limitations. The main purpose of use 5.XXX; is to signal "this code will not compile/run correctly on versions before 5.XXX". And you'd still get most of the functionality of 5.12 by just running 5.12, regardless whether you're using use 5.012; or not. (The only things you'll miss out on: say, given/when (but you do get smart match), state, Unicode strings and strict enabled). AFAIK, 5.14 will not introduce new features that aren't enabled by default.


In reply to Re: Why version strings? by JavaFan
in thread Why version strings? by gunzip

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, 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, 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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others musing on the Monastery: (4)
    As of 2021-05-08 13:42 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      Perl 7 will be out ...





      Results (96 votes). Check out past polls.

      Notices?