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~
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.