Hello:

Quick Summary: A new version of module isn't backward compatible. How can I incrementally upgrade pieces of a complex system that use this module?

I love Class::MethodMaker. It is used by almost every module I write (and I mean every). Unforunately the module has gone through a major interface change from v1.12 (which I use now) to v2.0x and I, of course, used lots of features which are not backward compatible. There are no technical reasons why I can't keep using the old 1.12, I just don't like using or having to install older, outdated, unsupported versions of currently available CPAN modules.

I also didn't simply use this module but inherited from it and made some nontrivial changes to how object inheritance, creation, and initialization work. This means I'm going to need to sit down and really understand how the module is working now and do some extensive functional behavior testing on it.

Once this is done, I expect it will take a week+ to get all my current scripts and modules changed over and tested. This is a week I just can't justify spending.

And of course the problem compounds itself in that any new code I write has to use the older version of the module too...so the situation keeps getting worse.

I can't come up with a good solution and need help.

I'd really like to at least be able to write any new code using the latest version of Class::MethodMaker while somehow letting the old code still work. But this would mean keeping two versions of the same module around. It would also mean, quite possibly, needing to have two versions of the same module loaded at the same time.

Is there any way I can do this? Is it possible to have two versions of the same module out there on your @INC and pick which one you use? Is it possible to actually load two different versions of the same module into your program at the same time?

Or am I looking at this problem in the wrong way? Are there any other possible solutions I've overlooked or help you can offer me? I've been struggling with this problem for a while and haven't come up with anything.

Currently I'm being forced to install the older versions of the library and do a

use Class::MethodMaker 1.12;

I know my example specifically mentions Class::MethodMaker but I've been pondering this same issue about some other modules I've written and for Perl in general. Normally Perl lets you do almost anything but it seems like this might be too much even for Perl.

And as an aside, what is going to happen when Perl6 comes out? Can you have both Perl5 and Perl6 installed on your system or will it be an all or nothing deal? All I have been able to discern so far is it is looking like Perl6 wont be compatible with Perl5.

Thanks

Update:

I realize I can install a local version to test / build with and I will be doing this for my initial work but once this is done, then what?

I have 4+ projects each using 30+ modules (many shared, some not) which almost all use this one module. The only choice seems to be update ALL the code at the same time to use the new module or update none of the code. I've been hoping there was something else besides the all or nothing solution.

I suppose this is what a CVS fork is for...but I really don't want to go that route either

Fendaria

In reply to Two(+) versions of same module? by Fendaria

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.