Summary: I would like to capture a complex @INC, so it does not have to be re-built at runtime.

Related: how to include a directory in @INC?

Goals:

Discussion:

I have a scenario, where many module versions are available in many directories. While there exist facilities to add these to @INC, they are only for runtime configuration. I have seen similar issues in the past, where modules where installed in a variety of locations and keeping track of them was too complex. In addition, there is always a risk of a module upgrade breaking existing code.

I would like to either find or write a perl prog, that can take the compiled @INC, delta it with anything brought in by PERL5LIB/PERLLIB, various 'use's and any other @INC hackery (which would be separately defined) and create a perisistent snapshot of the config, for example, in a single directory tree of symlinks. Subsequently, I would be able to run perl with PERL5LIB set to this directory and forget all the @INC hackery, as well as achieve the other goals above.

Is this a reasonable idea?

Does something like this already exist?

Is the suggested implementation approach of collecting symlinks in a single tree a reasonable one?

The only shortcoming to the above may be that it would only have utility on *nix and the like due to symlinks.

Thanks for the forthcoming wisdom.

In reply to Freeze @INC? by Surge

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.