If you have the entire environment then you could try a reductionist approach.

Find every lib dir that contains a .pm file and add them to $ENV{PERL5LIB}. That will hopefully make everything available so the process runs to completion. Then add an END{} block to the master script to print or dump @INC (and maybe also %INC) to a file. That will give you the necessary dirs to use.

Some caveats:

If the process runs then you might not care that you have too many entries in @INC, and thus there is no need to reduce the set.

This does not account for the order of libs, so might load incorrect versions and lead to subtle bugs. A check for .pm file uniqueness would be of benefit here.

It doesn't fix the underlying problem of using so many dirs in PERL5LIB in the first place, but that sounds like a second job.

If the full run takes days then it might not be worth the wait...

The END block will not list all the used dirs if some scripts are called using system, backticks and so forth.

An alternative given the last caveat might be to instrument the lib package to record each addition to @INC in a log file somewhere. Others can hopefully advise as to whether this is a reasonable idea and how it could be done.


In reply to Re: How to manage the transfer of large Perl environments from one network to another by swl
in thread How to manage the transfer of large Perl environments from one network to another by fiddler42

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.