Instead, use one of these:
require 5.006; # run-time BEGIN { require 5.006; } # compile-ti­me

I agree except for your comments. Instead you should only use:

require 5.006; # reason 5.006 is _required_

(with or without the BEGIN block).

There was (I hope it isn't still the case) a helper tool for creating modules that just stuffed in "require $];" into your module. This was a horrid idea.

"require 5.006;" does not mean "I haven't bothered to test with versions prior to Perl 5.006 and so can't guarantee that it works there". It means "I have tested on perls prior to 5.006 and can say for sure that this module fails on those versions" (well, it means at least the last half of that).

So, either leave off the "require 5.006" or add documentation about what you found (or just know) that doesn't work on such versions. Leaving it off isn't such a bad thing. The errors that result are usually pretty clear and tell you more than just "your Perl is too old", they highlight which new feature your old version of Perl doesn't support.

But, most importantly, don't add "require 5.006" (or whatever version of Perl) unless you actually know that such a version is really required.

- tye        


In reply to Re: Don't use 5.6.N (why) by tye
in thread Don't use 5.6.N by xdg

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.