Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (1)
As of 2024-04-25 01:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found