I would approach the problem by inspecting the output of perl -V:userelocatableinc. If that is defined, you can simply copy perl and all files to a different directory and everything will use the paths from the new directory. You might need to edit lib/Config.pm and lib/CPAN/Config.pm to point to the new directories too.

If the Perl was not compiled with a relocatable @INC, then you will need to adjust the module search path for Perl. The easiest way is to set PERL5LIB to the wanted new paths. To be really certain that the new copy of Perl does not use old paths, you should patch the new Perl executable to remove all references to the old path. Ideally, you replace the path by something with exactly the same length, for example by using:

perl -nle 's!/usr/share/perl5!/usr/share/____5!g' /path/to/new/perl

In reply to Re: Replicating perl instance on AIX 6.1 by Corion
in thread Replicating perl instance on AIX 6.1 by twieckow

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.