http://qs321.pair.com?node_id=94997

particle has asked for the wisdom of the Perl Monks concerning the following question:

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