I can not understand, why are you going in such complex ways here. Maybe I'm missing something from your description.

There's "require VERSION" and/or "use VERSION" that you can use in your modules and scripts to make sure, that they are not pulled in by wrong interpreter. In the cases, where you want to try your code with specific interpreter just use the desired binary directly

/usr/bin/perl.5.xx my_script.pl

After all, if you create a module that is not compatible with the perl that you are shipping, then this module won't be shipped, since it is useless.

If you want to have both versions of some module (for older and newer perl) then put them in different directories and in the script have something like

BEGIN{ unshift @INC, $ENV{MY_MODULES_DIR} if exists $ENV{MY_MODULES_DIR}; } use MyModule;

Now you can run your script as

MY_MODULES_DIR=experimental perl.5.xx my_script.pl
Or even create a small shell wrapper like
#!/bin/sh export MY_MODULES_DIR=experimental export OTHER_VARIABLE=value exec "$@"
and use it as
myenv perl5.xx my_script.pl

As usually, there's more than one way to do it. Maybe you'll find above something that would help you :)


In reply to Re: Dynamic $^X by andal
in thread Dynamic $^X by Tanktalus

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.