Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to upgrade perl modules that install from CPAN?

Tags:

upgrade

perl

cpan

In cpan shell, only /regexp/ or all modules can be upgrade, if I want to upgrade modules only installed by CPAN,how to do?

like image 722
zhangailin Avatar asked Jul 27 '12 02:07

zhangailin


People also ask

How do I remove a Perl module from CPAN?

Install App::cpanminus from CPAN (use: cpan App::cpanminus for this). Type cpanm --uninstall Module::Name (note the " m ") to uninstall the module with cpanminus.

How do I download Perl modules from CPAN?

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.


1 Answers

I suggest you using cpanm "family" script for perl modules management.

Install cpanm

  • skip this, if you already have it
  • curl -L http://cpanmin.us | perl - --sudo App::cpanminus
  • if you're on freebsd you can use instead curl the command fetch (see: man fetch)

Upgrade cpanm

  • skip this, if you installed it right now
  • cpanm --self-upgrade --sudo

Install cpan-outdated

  • cpanm App::cpanoutdated
  • The cpan-outdated command do the same as CPAN (r), but IMO better to use from shell

For example, only my notebook gives the result like:

marvin:~ jomo$ cpan-outdated
S/SM/SMUELLER/Attribute-Handlers-0.93.tar.gz
D/DR/DROLSKY/Class-Load-0.20.tar.gz
D/DR/DROLSKY/DateTime-TimeZone-1.47.tar.gz
... etc

Run cpan-outdated & upgrade modules

  • cpan-outdated -p | cpanm

Changes

If you want see what is changed (Change-log), you can try install cpan-listchanges

  • cpanm App::cpanlistchanges
  • and use it like: cpan-listchanges Plack - too see what's changed in Plack between your local and the latest on CPAN
like image 106
jm666 Avatar answered Sep 25 '22 09:09

jm666