view raw
zhangailin zhangailin - 11 months ago 37
Perl Question

How to upgrade perl modules that install from 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?


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

Install cpanm

  • skip this, if you already have it
  • curl -L | 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
... etc

Run cpan-outdated & upgrade modules

  • cpan-outdated -p | cpanm


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

  • cpanm cpan-listchanges
  • and use it like: cpan-listchanges Plack - too see what's changed in Plack between your local and the latest on CPAN