Show quoted text>>>>> On Thu, 20 Dec 2018 18:04:55 -0500, "Bill Cattey via RT" <bug-CPAN@rt.cpan.org> said:
Show quoted text > Thank you, Andreas, for taking the time to answer my question point by point.
You're welcome!
Show quoted text > I think I had an over-arching question that I asked poorly. Before I ask the question,
> I would like to air a misunderstanding I have about how cpan does its work.
Show quoted text > I will also note in passing that I have two parallel perl systems installed, and maybe that's ok,
> but I'm hoping that, as I understand better, I'll be able to better control whether or not the second one
> is actually kept and/or used.
Show quoted text > So I have two perl systems installed, the one that came with Mac OS. The main perl executable
> lives in /usr/bin/perl. (version 5.18)
Show quoted text > The other lives in /opt/local. (version 5.26) It got installed when, after my 10.13 upgrade, I tried to use
> macports to install cpanminus. I did "sudo port install p5-app-cpanminus". Oddly, that install didn't
> create a link from /opt/local/bin/perl to /opt/local/bin/perl5.26.
Show quoted text > Indeed I have /opt/local/bin/cpan-5.26 and /opt/local/bin/cpanm-5.26, but no perl, cpan, or cpanm
> in /opt/localbin. (I shall have to take this up with the macports folk to understand why that is so,
> since I did the macports install first, and expected it to shadow my system perl with a newer
> version and just work.
Show quoted text > My expectation was that I needed to run cpan as root, because I expected it would be
> performing installs into system directories, (as Macports did when it installed stuff in
> /opt/local.)
Show quoted text > (We're getting to my question. Thanks for your patience this far.)
Show quoted text > QUESTION:
Show quoted text > Is cpan intended for use by people who do not have access to system directories so that
> they can install Perl modules for themselves without bothering
> system administrators?
For every single thing it works on it has two types of phases, one for
downloading, building and testing stuff and one to install. Only the
installation phase is a candidate that may require root permissions.
Since perl knowns where to install, cpan and cpanm let other perl and
system tools do the installation. When root permissions are required for
the installation step, you can configure how to switch user which you
normally do with sudo. If root permissions are not required, you can
configure to not use sudo.
Show quoted text > I.E. Is it a mistake ever to run cpan as root?
Given that it downloads and installs software from the internet for you,
it is inherently dangerous and should not be run as root. Same for
cpanm.
Show quoted text > I think this means that my bug report should be closed as "Not a Bug", but also brings up
> a couple questions:
Show quoted text > 1. What document should I have read to have understood how to use
> cpan correctly?
I think the CPAN.pm manpage has everything you need. Then start learning
about other tools like probably local::lib. Your complications seem to
have their root in having to deal with two perls which may need some
extra knowledge about those.
Show quoted text > 2. Given that I have a cpan install in two places with inconsistent
> and broken legacy configurations, how do I clean this up?
chown -R you:you ~/.cpan
might be good enough. Whenever you have doubts that the system operates
the way you expect it to run, take a step back and find out what's
wrong. Backup your system and fix the problem before you continue using
the cpan shell. Reconfiguring your cpan installation is done with
o conf init
from the cpan shell.
Show quoted text > I apologize in advance for needing support instead of a bug fix.
np:)
--
andreas