CPAN tricks


What modules are installed on my system?

# <span style="text-decoration: underline;">cpan -l</span>

From the cpan prompt, how can I tell whether a module is already installed, and what version?

cpan> <span style="text-decoration: underline;">i <em>module_name</em></span>

And how can I tell which modules are out-of-date or have updated versions?

cpan> <span style="text-decoration: underline;">r</span>

…which gives a result like:

Package namespace installed latest in CPAN file
Archive::Extract       0.70   0.72 BINGOS/Archive-…0.72.tar.gz
Attribute::Handlers    0.94   0.96 SMUELLER/Attribute…0.96.tar.gz
AutoLoader             5.73   5.74 SMUELLER/AutoLoader-5.74.tar.gz
B::Debug               1.18   1.19 RURBAN/B-Debug-1.19.tar.gz
Carp                   1.29 1.3301 ZEFRAM/Carp-1.3301.tar.gz
Clone                  0.36   0.37 GARU/Clone-0.37.tar.gz
Compress::Bzip2        2.16   2.17 RURBAN/Compress-….tar.gz
DB_File               1.827  1.831 PMQS/DB_File-1.831.tar.gz
Data::Dumper          2.145  2.151 SMUELLER/Data…151.tar.gz