From the docs

use VERSION

Lexically enables all features available in the requested version as defined by the feature pragma, disabling any features not in the requested version's feature bundle. See feature

I never tried to use different versions inside the same file and I don't recommend it.

Here what I read (untested)

... it says that inside the scope of a use version all previous versions are to be considered irrelevant. IOW you can downgrade the features by going back to a lower version. ¹

There is ambiguity with certain pragmas like strict tho, when used simultaneously.

In the current implementation, any explicit use of use strict or no strict overrides use VERSION, even if it comes before it.

Those pragmas are implemented inside their own pm files, like strict.pm. And you can disable them with no

Those files "are not loaded" means they are not implicitly require d.

use version is implementing the effects directly and you can't rely on the pragma files being present. For instance by checking %INC

Again untested (I'm on Android right now) but this seems plausible.

> Why the hell is this written so opaquely?

The "opaqueness" is a result of the authors wanting to cover all rare edge cases.

I often wished that the perldocs were easier and covering the relevant 90% functionality in 10% text, while linking to the remaining 90% text covering the complicated edge cases most people avoid.

Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery

¹) see also feature#Lexical-effect


In reply to Re: "use VERSION does not load the feature.pm, strict.pm, or warnings.pm" by LanX
in thread "use VERSION does not load the feature.pm, strict.pm, or warnings.pm" by almr

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.