I am working on upgrading some core modules installed on a solaris machine used for development. I am using the CPAN shell to upgrade these modules.

The problem is that the path that the Makefile(s) wants to install the module(s) to is not the same as the location they are install to when perl is installed. That is, the "CORE" installation path (which I believe is referred to as 'perl') is different than the "CPAN" installation path (which I believe is called 'site'). This leaves us with two versions of the same module installed on the system, meaning that the version being used by applications is determined by the order of @INC, since both locations are in @INC. Currently the "CORE" path appears first, so the newer versions of such modules are not being used.

I came across this post: http://grokbase.com/post/2008/03/18/perl-and-cpan-distributors/qgHek3zF7tvfS9x8R2pwFHtSe0Q which suggests that, when recompiling perl, you set @INC to have the CPAN (or site) paths appear before the CORE (or perl) paths. This seems to make sense since you would expect the CPAN version to (in 99% of cases) be newer than the CORE version. Also, whenever a modules was upgraded the newest version would automatically be used since it would appear first in @INC.

This solution also appears to have the potential to cause issues if developers are modifying @INC in some fashion (manually or using a module) that would cause them to use the older version of the module. In this case, they could be beating their head against a wall for quite some time trying to figure out why they don't have some new functionality provided by the new version.

Another possible solution would be to somehow get the CPAN versions to clobber the CORE versions when they are upgraded. This would solve the problem, but there does not seem to be an easy way to do this. SOME core module Makefile.PLs take arguments that would allow you to change the default install location, but it is not consistent for each module. This means that putting Makefile.PL args in CPAN::Config may work for some modules but not for others. Essentially, in order to be sure, each module would have to be installed manually after having it's Makefile.PL inspected for any such arguments and even this would not work for all modules.

Does anyone know of any best practices in regards to this?


In reply to Upgrading Core Modules Using CPAN - Best Practice? by stocks29

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.