I needed to be able to load both modules concurrently so I can run them on the same array

I tried the following experiment with Math-GMPz (a perl extension):
1) Place version 0.31 of GMPz.pm in ./temp31/Math;
2) Place its GMPz.dll in ./temp31/auto/Math/GMPz;
3) Place version 0.32 of GMPz.pm in ./temp32/Math;
4) Place its GMPz.dll in ./temp32/auto/Math/GMPz;

Then run the following script:
use warnings; use strict; unshift @INC, "temp31"; require "temp31/Math/GMPz.pm"; print $Math::GMPz::VERSION, "\n"; unshift @INC, "temp32"; require "temp32/Math/GMPz.pm"; print $Math::GMPz::VERSION, "\n";
which outputs (as desired):
0.31 0.32
and just goes to prove that one can easily (albeit a bit kludgily) load 2 different versions of the same perl extension into the same script.

You should be able to apply the same technique with Devel::Size.

Cheers,
Rob

UPDATE: However, I note it's not quite so simple if I try to load them in the reverse order (ie first load 0.32, then 0.31):
0.32 Math::GMPz object version 0.32 does not match bootstrap parameter 0.31 + at C:/_32/ap1007/lib/DynaLoader.pm line 224. Compilation failed in require at try.pl line 10.
Not sure why that happens - perhaps some %INC manipulation would counter it.
And, I guess, if you have to keep switching between the 2, then things get even messier.

In reply to Re^3: Module development: concurrent versions (Updated) by syphilis
in thread Module development: concurrent versions (Updated) by BrowserUk

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.