I would think that if the package line itself used syntax that did not work in older perls, then the use or feature would certainly have to come first!
That’s an interesting point. As of 5.14, you can do this:
package NAMESPACE VERSION;
That sets the appropriate version number in that namespace, at compile time, and in a declarative fashion so that the toolchain doesn’t have to run (or simulate running) the code just to ascertain the package’s version number. It is also superior in that it puts the version number right at the top where it belongs, guaranteeing that it won’t drift down in the module as time goes by, as so often seems to occur.

And that’s not all. You can also do this:

package NAMESPACE BLOCK
To create a lexical scope smaller than that of the rest of the file scope for the package declaration to govern. And of course you may combine these:
package NAMESPACE VERSION BLOCK
If you’re going to do this, it does make some sense to put a use 5.014 before that in your code. With all the myriad differences in Perl that have come about in the 5.10, 5.12, and 5.14 releases, I’ve for some time now taken to prominently placing a use 5.012 (or whatever) as the first thing in the file. It’s a way of declaring the version of Perl that I developed and tested the code under, and an indication that I have no intention of backporting and testing and maintaining it on Perls older than that.

In reply to Re: 'use' inside or outside of package declaration? by tchrist
in thread 'use' inside or outside of package declaration? by John M. Dlugosz

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.