简体   繁体   English

如何升级用户目录中安装的所有perl CPAN模块?

[英]How to upgrade all perl CPAN modules installed in a user directory?

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. 我有一个包含CPAN模块的用户目录,并且我想要一个脚本来将所有升级到其最新版本。

Note: it should be executable by any user not only root. 注意:任何用户都应该可以执行此命令,而不仅仅是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. 我知道cpan -r应该升级CPAN模块,但是我想强迫它仅对安装在此特定目录中的那些模块执行此操作。

cpan-outdated can help you. cpan-outdated可以为您提供帮助。

https://metacpan.org/module/cpan-outdated 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
cd ~/perl5/lib &&
find -name '*.pm' \
| perl -ple's{^\./}{}; s{/}{::}g; s{\.pm\z}{};' \
| xargs cpan

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM