in reply to Upgrading Core Modules Using CPAN - Best Practice?

This means that putting Makefile.PL args in CPAN::Config may work for some modules but not for others.

Could you point out an example module that doesn't allow to configure its install destination?  I mean, if this is true, how would CPAN.pm then achieve to install the module in the 'site' subtree, as you're saying? (just wondering)

  • Comment on Re: Upgrading Core Modules Using CPAN - Best Practice?

Replies are listed 'Best First'.
Re^2: Upgrading Core Modules Using CPAN - Best Practice?
by perlsaran (Sexton) on Oct 03, 2008 at 02:25 UTC
    In the cpan shell, type the following command with the specific path where you need to update the core modules cpan> o conf makepl_arg PREFIX='<dir path>' cpan> o conf commit Default lib path will be changed after this command.. Lemme know if it works

      Getting the modules into the PREFIX path is not the problem. It is ensuring that the modules is installed in the correction location w/in the PREFIX path that is the problem:

      PREFIX=/usr/local/perl5.8.6
      /usr/local/perl5.8.6/lib/5.8.6/sun4-solaris/Errno.pm (core) /usr/local/perl5.8.6/lib/site_perl/5.8.6/Errno.pm (cpan)
Re^2: Upgrading Core Modules Using CPAN - Best Practice?
by stocks29 (Acolyte) on Oct 03, 2008 at 14:42 UTC

    First off, thanks for all the feedback so far. 'Errno' is an example of one such module. This modules was installed as a core module to: /usr/local/perl5.8.6/lib/5.8.6/sun4-solaris/Errno.pm

    When I use CPAN to install this module, it defaults to installing in: /usr/local/perl5.8.6/lib/site_perl/5.8.6/Errno.pm

    I tried to specify the following arguments that would be passed to Makefile.PL to adjust the install path: 'makepl_arg' => qq[INSTALLDIRS=perl}

    With this makepl_arg set, the module still installs into the same directory.

    I did run across a post that suggested specifying the INSTALLPRIVLIB to the value of $Config{archlibexp} (while 'use'-ing Config), which does seem to tell the module to install into the correct location.

    So, if specifying the INSTALLPRIVLIB makepl_arg is a possible solution, the questions that remain are:

    • Do all core modules specify INSTALLDIRS=perl as their default location? If not, we would have to add this to CPAN::Config which may cause issues for non-core modules.
    • If I specify INSTALLPRIVLIB=$Config{archlibexp} in CPAN::Config, could this cause problems for some modules?

    Lastly, getting back to the original question, regardless of how it is done, is clobbering the old (core) version with the new (cpan) version of the module the recommended solution? Or would anyone suggest the @INC overlays?