Re: Need some help on installing modules...

[email protected] ("Daniel Staal")
Newsgroups perl.macosx
Message-ID <[email protected]>
On Sun, January 16, 2011 5:29 pm, Levan, Jerry wrote:

> Is doing a:
>
> sudo perl -MCPAN -e shell
>
> The standard way of preparing to install modules?
>
> Seems like root might only be needed for actual installation...

Current versions of CPAN can be configured to request a sudo password at
the install step, while running the rest with normal permissions.

IIRC (I use cpanp, and I haven't had to set this up in a while):

>   o conf make_install_make_command 'sudo make'
>   o conf mbuild_install_build_command 'sudo ./Build'
>   o conf commit

In the CPAN shell should set it up for you.  Depending on what order
you've done things in, some temp folders may have been created with
root-only access at this point, which you might need to change.  (That is:
If they were created by a 'sudo' run, they'll have root-only access. 
Otherwise they'll have access for your user.)

You also don't need to go to the shell, and 'cpan' should be installed as
a stand-alone script:

> cpan i Module::Name

But all of that is basically just making things a bit less verbose and
noisy.  (And the one safety of not running tests as root.  Note that some
module tests will _fail_ if run as root...)

Daniel T. Staal

---------------------------------------------------------------
This email copyright the author.  Unless otherwise noted, you
are expressly allowed to retransmit, quote, or otherwise use
the contents for non-commercial purposes.  This copyright will
expire 5 years after the author's death, or in 30 years,
whichever is longer, unless such a period is in excess of
local copyright law.
---------------------------------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.