Reputation: 976
In cpan shell, only /regexp/ or all modules can be upgrade, if I want to upgrade modules only installed by CPAN,how to do?
Upvotes: 16
Views: 30622
Reputation: 183
reinstalling the perl package will automatically upgrade using
cpanm --reinstall <Module_Name>
Upvotes: 1
Reputation: 63974
I suggest you using cpanm "family" script for perl modules management.
curl -L http://cpanmin.us | perl - --sudo App::cpanminus
cpanm
cpanm --self-upgrade --sudo
cpanm App::cpanoutdated
For example, only my notebook gives the result like:
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
If you want see what is changed (Change-log), you can try install cpan-listchanges
cpanm App::cpanlistchanges
cpan-listchanges Plack
- too see what's changed in Plack between your local and the latest on CPANUpvotes: 20
Reputation: 1128
# 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
Running just the below command will do what you ask.
cpan> upgrade
Upvotes: 8
Reputation: 386621
$ cpan Module
and
cpan> install Module
will upgrade if a newer version is available, and do nothing if you already have the latest version.
Upvotes: 5
Reputation: 956
You should first log into cpan. Then, once at the prompt type:
r [enter]
That will print out a list of upgradable modules that are installed. After you have that list to work off of you can use the following:
cpan upgrade <MODULE NAME>
Simply replace with the name of the module to upgrade.
Regards,
Jeff
Upvotes: 4