I use perl 5.005_03. It is what the sysops have installed on my server, and the default perl that came on my NT box at work. I don't really plan to upgrade, as this would involve installing a local perl (and eating up my home disk quota), and honestly I don't have any problems.

I am sure that there is still a lot of 5.005 out there, as well as 5.6 and 5.8. While the differences aren't dramatic, it only takes one line to make a program fail.

I think that, in light of the many versions out there, code authors need to be sure they think about this when coding -- and many do. It should become a new standard for robust code, along with strict and warnings.*

The bigger question is, of course, at what point do you continue to code for older versions, and at what point do you give them up? This is very much analagous to the situation with html and web browsers.

However, I don't want to go there right now. What do other monks think? Should it be best practice to start all programs with:

#/usr/bin/perl -w use strict; require 5.X;

* Of course, use warnings; instead of -w will fail on 5.005!!

</ajdelore>


In reply to Code should be version-aware by ajdelore

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.