Hi DennisLGolden,

In one of your replies in this thread you wrote "If UID and GID are always 1000:1000 from CPAN, I can live with it." I just downloaded three .tar.gz files from CPAN at random and can verify that it is not the case, I've got varying UID/GIDs.

Tar archives store the UID/GID information, and my understanding is that when extracting tar archives as root, those UID/GIDs will be restored, and when running as a normal user they won't (because they can't). So CPAN may not change the permissions, but untarring as root does.

Modifying the system Perl is a whole nother topic, but one of the reasons not to do so, in short, is that installing modules into the system Perl can go wrong, and then picking apart the mess caused by that can be pretty bad. I now always install a fresh Perl in a different location (you can do this by hand fairly easily or with perlbrew), and install all the modules I want there, and I see doing so recommended often. When I install modules into the system Perl I only use the system's repositories and package manager.

Having said that, it's possible to clean up the situation - as was already said, you could just sudo chown -R the ~/.cpan directory. Another possible solution that hasn't been mentioned yet is to run the build process as a normal user, but configure CPAN to use sudo for only those commands where it is necessary, which is the "install" step. Search the CPAN page for "sudo", and it'll reveal the two config options you need to set: make_install_make_command and mbuild_install_build_command (note I haven't tried this myself but I see it referenced in several articles online).

Hope this helps,
-- Hauke D


In reply to Re: cpan build environment by haukex
in thread cpan build environment by DennisLGolden

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.