i'd like to be able to use a specific version of perl to run a perl script. i've been asked to ensure my code is compatible with the company standard perl distributions (5.004 and 5.6.0.) also, i've been asked if there is a way to enforce this compatibility at runtime. i'd like to be able to do something like this at the top of my scripts~
use v5.6.0; no use v5.6.1;
which would say 'use 5.6.0 or higher, but don't use 5.6.1 or higher. but i'm not sure this will work, or if it's clear. i could code something like~
die( printf("must use perl version %vd\n", $^V) ) unless $^V eq 5.6.0; # only use company standard perl 5.6.0
which checks the version of perl and dies otherwise, but then i don't know if $^V will work correctly in earlier versions of perl, or if i should use $] as in $] eq 5.006. in this case, i don't know how 5.6.1 displays in $].

i have 5.6.0 installed on Win2000, and i can't install any other versions to test. go figure.

~Particle


In reply to use _specific_ version by particle

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.