zha*_*lin 15 perl cpan upgrade
在cpan shell中,只有/ regexp /或所有模块都可以升级,如果我想升级只由CPAN安装的模块,该怎么办?
jm6*_*666 19
我建议你使用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
Run Code Online (Sandbox Code Playgroud)
cpan-outdated -p | cpanm
如果要查看更改内容(更改日志),可以尝试安装cpan-listchanges
cpanm App::cpanlistchanges
cpan-listchanges Plack
- 也看看普拉克在本地和最新的CPAN之间发生了什么变化# 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
Run Code Online (Sandbox Code Playgroud)
只运行以下命令就可以满足您的要求.
cpan> upgrade
Run Code Online (Sandbox Code Playgroud)
$ cpan Module
Run Code Online (Sandbox Code Playgroud)
和
cpan> install Module
Run Code Online (Sandbox Code Playgroud)
如果有更新的版本可用,将升级,如果您已经有最新版本,则不执行任何操作。