Description of problem: The command cpan install WeakRef installed the module incorrectly into /root/perl5/lib/perl5/x86_64-linux-thread-multi/auto instead of the global directory. Version-Release number of selected component (if applicable): perl-CPAN-2.00-289.fc20.noarch How reproducible: Every time. Steps to Reproduce: As root enter- 1. yum install perl-CPAN 2. cpan install WeakRef 3. Actual results: Module installed in /root/perl5/..... Expected results: Module installed in /usr/local/share/perl5 Additional info: It is possible to clear this bug by removing /root/.cpan and /root/perl5/, editing out the two lines cpan adds to /root/.bashrc, closing the shell and reopening then rerunning the command, but selecting manual as the installation method.
This is matter of cpan tool configuration. If you configured cpan to install files into ~/perl5, then it will install it there. If you remove ~/.cpan/CPAN/MyConfig.pm (or the global one under /usr/share/perl5), and run cpan(1) again, you get question, where how to install the files: Warning: You do not have write permission for Perl library directories. To install modules, you need to configure a local Perl library directory or escalate your privileges. CPAN can help you by bootstrapping the local::lib module or by configuring itself to use 'sudo' (if available). You may also resolve this problem manually if you need to customize your setup. What approach do you want? (Choose 'local::lib', 'sudo' or 'manual') The message is a little bit misleading, because the real error is that /usr/local/{lib*,share}/perl5 do not exist. If select `manual' or if you create the directories, cpan will install into the site perl directories.
Granted, but the point is that installing out of the box cpan doesn't work. By reading the code and experimenting I manged to get it to life, but for the ordinary user this would be a pain. As supplied cpan does not let you install modules. To my mind this is wrong.
Who said that "installing out of the box" means "install into site directories"?
I think the cpan(1) tool could be augmented to create the site directories if they are missing.
I fixed it as perl-CPAN-2.05-308.fc22 in F22. Older Fedoras will patch the perl sources.
Created attachment 952169 [details] Fix ported to perl-5.18.4
perl-5.18.4-305.fc21 has been submitted as an update for Fedora 21. https://admin.fedoraproject.org/updates/perl-5.18.4-305.fc21
perl-5.18.4-291.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/perl-5.18.4-291.fc20
Package perl-5.18.4-305.fc21: * should fix your issue, * was pushed to the Fedora 21 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing perl-5.18.4-305.fc21' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2014-13948/perl-5.18.4-305.fc21 then log in and leave karma (feedback).
perl-5.18.4-291.fc20 has been pushed to the Fedora 20 stable repository. If problems still persist, please make note of it in this bug report.
perl-5.18.4-305.fc21 has been pushed to the Fedora 21 stable repository. If problems still persist, please make note of it in this bug report.