【发布时间】:2012-07-25 16:49:18
【问题描述】:
在cpan shell中,只能升级/regexp/或all模块,如果我想升级只有CPAN安装的模块,怎么办?
【问题讨论】:
-
... 与 Perl 附带的模块相反,模块是从系统的包管理器安装的?请澄清。
在cpan shell中,只能升级/regexp/或all模块,如果我想升级只有CPAN安装的模块,怎么办?
【问题讨论】:
我建议你使用 cpanm "family" 脚本来管理 perl 模块。
curl -L http://cpanmin.us | perl - --sudo App::cpanminuscpanm
cpanm --self-upgrade --sudocpanm 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如果你想看看有什么变化(Change-log),你可以尝试安装cpan-listchanges
cpanm App::cpanlistchangescpan-listchanges Plack - 还可以查看 Plack 中本地和 CPAN 上最新版本之间的变化
【讨论】:
>cpanm cpan-outdated 不工作 - ! Couldn't find module or a distribution cpan-outdated
$ cpan install App::cpanoutdated App::cpanlistchanges
# 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>
【讨论】: