[英]How to upgrade perl modules that install from CPAN?
在cpan shell中,只有/regexp/或所有模塊都可以升級,如果我想升級只有CPAN安裝的模塊,怎么辦?
我建議您使用 cpanm “family” 腳本進行 perl 模塊管理。
curl -L http://cpanmin.us | perl - --sudo App::cpanminus
cpanm
cpanm --self-upgrade --sudo
cpanm App::cpanoutdated
例如,只有我的筆記本給出如下結果:
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
cpan-outdated -p | cpanm
如果您想查看更改的內容(更改日志),您可以嘗試安裝cpan-listchanges
cpanm App::cpanlistchanges
cpan-listchanges Plack
- 也看看你的本地和 CPAN 上的最新版本之間在 Plack 中發生了什么變化# cpan
cpan> h
Display Information (ver 1.9800)
command argument description
a,b,d,m WORD or /REGEXP/ about authors, bundles, distributions, modules
i WORD or /REGEXP/ about any of the above
ls AUTHOR or GLOB about files in the author's directory
(with WORD being a module, bundle or author name or a distribution
name of the form AUTHOR/DISTRIBUTION)
Download, Test, Make, Install...
get download clean make clean
make make (implies get) look open subshell in dist directory
test make test (implies make) readme display these README files
install make install (implies test) perldoc display POD documentation
Upgrade
r WORDs or /REGEXP/ or NONE report updates for some/matching/all modules
upgrade WORDs or /REGEXP/ or NONE upgrade some/matching/all modules
Pragmas
force CMD try hard to do command fforce CMD try harder
notest CMD skip testing
Other
h,? display this menu ! perl-code eval a perl command
o conf [opt] set and query options q quit the cpan shell
reload cpan load CPAN.pm again reload index load newer indices
autobundle Snapshot recent latest CPAN uploads
僅運行以下命令即可滿足您的要求。
cpan> upgrade
$ cpan Module
和
cpan> install Module
如果有更新的版本可用,將升級,如果您已經有最新版本,則不執行任何操作。
您應該首先登錄 cpan。 然后,一旦在提示符下鍵入:
r [enter]
這將打印出已安裝的可升級模塊列表。 在您擁有該列表后,您可以使用以下內容:
cpan upgrade <MODULE NAME>
只需替換為要升級的模塊的名稱。
問候,
傑夫
重新安裝 perl 包將使用自動升級cpanm --reinstall <Module_Name>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.