To solve this problem, do a manual upgrade of CPAN (apparently on OS X CPAN has trouble upgrading itself). You can download the source from here. After you have downloaded it uncompress it, create the make file from the Perl script, then run a make test, and finally if all goes well a make install.
CPAN doesn't actually install files. It runs the install script embedded in each distribution, which then performs the actual install. For distributions using ExtUtils::MakeMaker, the defaults are documented here: https://metacpan.org/pod/ExtUtils::MakeMaker#make-install (and the default value of INSTALLDIRS is site ).
The main difference between the two is that if you have Perl you should already have the cpan command. Whereas you won't have cpanm unless/until you install it.
To install Perl modules using CPAN, you need to use the cpan command-line utility. You can either run cpan with arguments from the command-line interface, for example, to install a module (e.g Geo::IP) use the -i flag as shown.
An alternative method to using upgrade
from the default CPAN shell is to use cpanminus
and cpan-outdated
.
These are so easy and nimble to use that I hardly ever go back to CPAN shell. To upgrade all of your modules in one go, the command is:
cpan-outdated -p | cpanm
I recommend you install cpanminus
like the docs describe:
curl -L https://cpanmin.us | perl - App::cpanminus
And then install cpan-outdated
along with all other CPAN modules using cpanm
:
cpanm App::cpanoutdated
BTW: If you are using perlbrew
then you will need to repeat this for every Perl you have installed under it.
You can find out more about cpanminus
and cpan-outdated
at the Github repos here:
An easy way to upgrade all Perl packages (CPAN modules) is the following way:
cpan upgrade /(.*)/
cpan will recognize the regular expression like this and will update/upgrade all packages installed.
For Strawberry Perl, try:
cpan -u
Try perl -MCPAN -e "upgrade /(.\*)/"
. It works fine for me.
upgrade
BTW there is a help
command.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With