perldb2 has asked for the wisdom of the Perl Monks concerning the following question:

Hi I have a working PERL in my El Capitan OSX server. All i want is to install a perl module Finance::YahooQuote. Here are the commands I executed: perl -MCPAN -e shell here is the output. I do understand that there is a permission problem but I am not sure how to fix it! Any help would be much appreciated.
cpan shell -- CPAN exploration and modules installation (v2.00) Enter 'h' for help. cpan[1]> install Finance::YahooQuote + + Reading '/Users/xxxx/.cpan/Metadata' Database was generated on Wed, 27 Jan 2016 17:29:02 GMT Running install for module 'Finance::YahooQuote' Running make for E/ED/EDD/Finance-YahooQuote-0.25.tar.gz Fetching with LWP: http://cpan.mirror.vexxhost.com/authors/id/E/ED/EDD/Finance-YahooQuote +-0.25.tar.gz Can't chown '/Users/xxxx/.cpan/FTPstats.yml.23232' to root/staff: Oper +ation not permitted Fetching with LWP: http://cpan.mirror.vexxhost.com/authors/id/E/ED/EDD/CHECKSUMS Checksum for /Users/xxxx/.cpan/sources/authors/id/E/ED/EDD/Finance-Yah +ooQuote-0.25.tar.gz ok Scanning cache /Users/xxxx/.cpan/build for sizes ..................I have neither the -x permission nor the permission +to change the permission; can only partially estimate disk usage of ' +ReadLine' Can't cd to (/Users/xxxx/.cpan/build/Term-ReadLine-Perl-1.0303-kHAm4b/ +) ReadLine: Permission denied at /System/Library/Perl/5.18/CPAN/CacheMgr.pm line 137. ..........................................................DONE CPAN.pm: Building E/ED/EDD/Finance-YahooQuote-0.25.tar.gz Checking if your kit is complete... Looks good Generating a Unix-style Makefile Writing Makefile for Finance::YahooQuote Writing MYMETA.yml and MYMETA.json cp YahooQuote.pm blib/lib/Finance/YahooQuote.pm cp yahooquote blib/script/yahooquote "/usr/bin/perl" -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/ya +hooquote Manifying 1 pod document Manifying 1 pod document EDD/Finance-YahooQuote-0.25.tar.gz /usr/bin/make -- OK Running make test PERL_DL_NONLAZY=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::H +arness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/l +ib', 'blib/arch')" t/*.t t/01base.t ...... ok t/02simple.t .... ok t/03extended.t .. ok t/04custom.t .... ok t/05test.t ...... ok All tests successful. Files=5, Tests=8, 2 wallclock secs ( 0.05 usr 0.03 sys + 0.69 cusr + 0.17 csys = 0.94 CPU) Result: PASS EDD/Finance-YahooQuote-0.25.tar.gz /usr/bin/make test -- OK Running make install Manifying 1 pod document Manifying 1 pod document !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! ERROR: Can't create '/Library/Perl/5.18/Finance' mkdir /Library/Perl/5.18/Finance: Permission denied at /System/Library +/Perl/5.18/ExtUtils/Install.pm line 469. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! at -e line 1. make: *** [pure_site_install] Error 13 EDD/Finance-YahooQuote-0.25.tar.gz /usr/bin/make install -- NOT OK Failed during this command: EDD/Finance-YahooQuote-0.25.tar.gz : install NO

Replies are listed 'Best First'.
Re: OSX Server Perl install modules
by jeffa (Bishop) on Jan 27, 2016 at 19:54 UTC

    You need to run that under sudo. Also, you might want to consider using perlbrew which will allow you to install modules as a non-privileged user. From the shell:

    $ sudo cpan

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)
    
      Well sudo does not work either
      cpan[2]> sudo install Finance::YahooQuote + + Unknown shell command 'sudo'. Type ? for help.
        You need to use sudo for the CPAN shell:
        sudo perl -MCPAN -e shell ... cpan> install Finance::YahooQuote
Re: OSX Server Perl install modules
by kcott (Archbishop) on Jan 28, 2016 at 23:39 UTC

    G'day perldb2,

    Welcome to the Monastery.

    I see you have a solution to your immediate problem. You may also be interested in "CPAN on El Capitan" (posted a few months ago) which has more general information regarding this matter.

    — Ken