2

I have a user directory with CPAN modules and I want to have a script that will upgrade all of the to their latest release.

Note: it should be executable by any user not only root.

What is the proper command to do this?

I know that cpan -r should upgrade CPAN modules but I want to force it to do this only for those installed in this specific directory.

friedo
  • 65,762
  • 16
  • 114
  • 184
sorin
  • 161,544
  • 178
  • 535
  • 806

2 Answers2

1

cpan-outdated can help you.

https://metacpan.org/module/cpan-outdated

upgrade all versions installed:

cpan-outdated | cpanm

upgrade modules installed in a specified dir

cpan-outdated -lextlib | cpanm -lextlib
FUJI Goro
  • 869
  • 10
  • 19
0
cd ~/perl5/lib &&
find -name '*.pm' \
| perl -ple's{^\./}{}; s{/}{::}g; s{\.pm\z}{};' \
| xargs cpan
ikegami
  • 367,544
  • 15
  • 269
  • 518