|Home » Faqs » Documentation » Module version|
If you have
cpan installed (type
cpan in your command prompt), then
you can use:
will produce something like the following output:
CPAN: Storable loaded ok (v2.18) Going to read '/root/.cpan/Metadata' Database was generated on Mon, 09 Jul 2012 05:27:04 GMT CPAN: YAML loaded ok (v0.72) Going to read 82 yaml files from /root/.cpan/build/ CPAN: Time::HiRes loaded ok (v1.9711) DONE Restored the state of none (in 1.2623 secs) Module id = CGI DESCRIPTION Simple Common Gateway Interface Class CPAN_USERID LDS (Lincoln D. Stein
) CPAN_VERSION 3.59 CPAN_FILE M/MA/MARKSTOS/CGI.pm-3.59.tar.gz DSLIP_STATUS RdpOp (released,developer,perl,object-oriented,Standard-Perl) MANPAGE CGI - Simple Common Gateway Interface Class INST_FILE /usr/share/perl/5.10/CGI.pm INST_VERSION 3.29
If you have
cpanplus installed, (type
you can use:
will produce something like the following, (some output omitted for clarity):
Details for 'CGI' Author Mark Stosberg (firstname.lastname@example.org) Description Simple Common Gateway Interface Class Development Stage Released Installed File /usr/local/perl_dev/lib/5.10.1/CGI.pm Interface Style Object oriented using blessed references and/or inheritance Language Used Perl-only, no compiler needed, should be platform independent Package CGI.pm-3.59.tar.gz Public License Standard-Perl: user may choose between GPL and Artistic Version Installed 3.43 Version on CPAN 3.59 Contains: CGI 3.59 CGI::Apache 1.01 CGI::Carp 3.51
The cpanplus shell is particularly powerful and it's many command line options are well worth the effort to master.
If the author of a module has implemented a VERSION variable, (most do), you can use Perl from the command line to determine the module version.
perl -M[modulename] -e 'print "$[modulename]::VERSION\n";'
perl -MCGI -e 'print "$CGI::VERSION\n";'
This would produce something like:
Like solution 2, you can use perl from the command line to determine the module version, only the quotes are slightly different:
perl -M[modulename] -e "print \"$[modulename]::VERSION\";"
perl -MCGI -e "print \"$CGI::VERSION\";"
From your command line you can type 'ppm'. If you type in:
ppm will display information about the modules installed. This does not include standard perl modules, so, for example,
will not return any data. However:
will return something like:
DBI [1.14] Database independent interface for Perl