If I'm using Perl 5.16 why do I have to type:

use 5.016;

... at the top of every script?

Perl is quite capable of determining which version it is running with $^V so why should every modern Perl script have to pay the penalty for spoonfeeding those who are running old code on an upgraded version of Perl like this? It gets worse in Perl 6 with:

use v6;

If we're concerned with backwards compatibility with Perl 5 then "use v6;" should be implicit and we specify "use v5;" as required. Better still, just make use of $^V and be done with it, otherwise we're just saddling the language with boilerplate baggage.

Likewise, with "my" variable declarations:

my $var = 'whatever';

If we've admonished for so many years to (almost) always use "my" variables for proper scoping surely it is now time to makey "my" implicit? Since 5.16 "use strict" has been implicit so the same should apply to "my" declarations. A "use no my;" pragma could be introduced to manage special cases.


In reply to Make $^V and "my" implicit 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, 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.