Ah, my mistake, I thought that a native perl would not look under /usr/local/ for modules, so your errno problems seemed to indicate a custom perl install. If I do perl -V on my SuSe, there are no /usr/local/... paths in @INC.

Generally it is not advisable to mix OS updates and CPAN with core modules or those installed by a minimal debian install (since some of them get patched by debian). If the module was not already installed by debian, a cpan install is harmless

When you use CPAN, make sure it doesn't overwrite OS perl modules (that should normally be the case, as OS perl modules should reside in /usr/lib or /usr/share and cpan defaults to /usr/local AFAIK. Don't change that, then you are pretty safe).

But since you have updated core modules with cpan, one alternative would be just to try to live with it. Most of the time you should have no problems with that. Errno.pm is more the exception than the rule

The other alternative is as I said in my first post, just delete the stuff under /usr/local/share/perl and edit perllocal.pod accordingly. That should effectively rid you of your cpan-installed modules.

This is because your debian perl modules were not overwritten by cpan. The cpan modules have just a higher priority and so mask the original debian modules that are stored under /usr/share/

You can test this by installing a small perl module with apt-get and look where it was stored. Then install a newer version of the module with cpan and look where that was stored. Both versions should be on your disk, just in different dirs. Patch one with a print statement and find out which is used by a simple script (presumably the cpan version). Now delete that version (by deleting the <modulename>.pm) and the old version should be used again.

Another indication that this is true was your deletion of (cpan) Errno.pm. After that the install of cpio worked so perl must have found the original Errno.pm from debian.

So if you remove the cpan modules completely (or rename the dirs under /usr/share/perl/) you should have your native perl back. And then (after editing perllocal.pod? Don't know if this file is used by cpan) you can install cpan modules again, just make sure you don't touch system modules. CGI for example should be quite safe to install with cpan

PS: You asked about a dual perl installation in your first posting. That is easy if those perls differ in version (because one looks under /.../5.8.8/ for its modules, the other under /.../5.10/ for example) but with two perls of the same version you have to do much more. That's why I was talking about perl5.10. It just makes it easy to keep debian perl and cpan perl apart.

UPDATE: A fast way to check that none of the files in /usr/local/share/perl were installed by debians package manager:

find /usr/local/share/perl -print | xargs dpkg -S | less
dpkg -S tells you from which package a file is. Check the list. If none of the files are from a package, debian doesn't store any files there.

By doing the same with /usr/share/perl and looking for non-package files you can find out if cpan has installed anything in debians area.


In reply to Re^5: TT2 and FB between two different installations by jethro
in thread TT2 and FB between two different installations by LesleyB

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.