@INC is in the perl binary. Shocking, isn't it?

strings `which perl`|grep /usr/lib

I can tell you how I recently cleaned up my installation. I didn't have multiple perls, though, and I'm also not on Debian.

  1. I made note of which modules I have installed. cpan's autobundle feature did that. I also made a backup of perllocal.pod. These serve as a reminder of what I need to reinstall later. Obviously, I didn't reinstall everything.
  2. I cleaned up the vendor_perl directory first. I used the package manager to delete all module installed through it, making note of some dependents. I'd lose some applications that make use of those modules for the time of cleaning, but I'd reinstall the applications later. Then vendor_perl was reasonably clean, what was left I recognised as belonging to indispensible system tools, the package manager or perl itself (.ph files).
  3. I cleaned up site_perl as described in the CPAN FAQ. Those .packlist files are really useful. Sometimes I had to delete manually because of botched forced installations. The junk what was left afterwards I just moved out of the way. As it turned out, nothing of it was useful later, but better be safe than sorry.
  4. I was left with a lot of empty directories. I ran find with rmdir a couple of times do get rid of them.
  5. Lastly, I reinstalled in my package manager the perl package, so that the files in the 5.8.8 directory were guarantueed to be originals again.
(update: rmdir)

In reply to Re: cleaning up old libs and @INC by daxim
in thread cleaning up old libs and @INC by danmcb

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.