While I understand there are times when you can't get around it, I really hate maintaining legacy perl trees. This tends to work ok if the machine's environment is relatively static. The problem I've seen with this is that as you upgrade the machine's OS, C compiler, libraries, etc then legacy code becomes more and more brittle and can eventually break in some hard to detect/fix way. Worse, if you need that upgrade to keep your newer code running smoothly, you now have a dilema (e.g. downgrade and workaround it; keep the upgrade, reinstall the old perl tree, and hope it works).

I tend to compromise on this by keeping two versions of perl -- the vendor's ancient perl (/usr/bin/perl); and my own in it's own tree where I symlink to it from /usr/local/bin/perl. Any script that uses /usr/local/bin/perl tacitly agrees it will work with newer versions of perl. When I rebuild perl in a new tree, I make sure the modules in the old tree are installed in the new one as well. This allows me to move the tree easily to similar machines once it's configured properly.

Of course, in order to actually verify that the older code works with a newer perl, it needs to be easily testable. This is where a test suite is crucial, and may actually be worth adding to your legacy code if you don't already have one. If it's not possible, you may be able to make a similar policy that you only support perl versions x and y and that any new code must have a test suite.


In reply to Re: Smooth perl upgrades by bluto
in thread Smooth perl upgrades by saintmike

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.