Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

We built our own perl aside from the OS perl, now I want to move it from one path to another so just cp -r it. When I try to install modules it's trying to write them to the old location. How do I change this? Is this INC? What steps do I need to make to update these paths system wide?

Replies are listed 'Best First'.
Re: Moving perl
by Corion (Patriarch) on Aug 21, 2015 at 10:34 UTC

    If you used -Duserelocatableperl when compiling your own Perl, you can "just"

    1. Copy the Perl tree to a new location
    2. Update lib/Config.pm with the new path
    3. Update site/lib/CPAN/Config.pm with the new path

    If you did not use -Duserelocatableperl, you cannot easily move Perl because many paths are hardcoded into Perl. The easy approach here is to recompile Perl and then either reinstall all modules or copy all modules and pray that you used exactly the same configuration settings as before.

      Yup, Portable can help you fake that :)
      /new/path/perl.exe -MPortable foo.pl /new/path/perl.exe -MPortable -S cpan Module Module Module
Re: Moving perl
by jeffa (Bishop) on Aug 21, 2015 at 16:20 UTC

    If the necessary route is indeed having to reinstall Perl and the CPAN modules you need, you should really have a look at perlbrew. It allows you to install, switch to and manage as many versions of Perl as you like as a non-privileged user, quickly.

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)