How do I tell what version of a module is installed?

CPAN

If you have cpan installed (type cpan in your command prompt), then you can use:

    i ModuleName

For example:

    i CGI

will produce something like the following output:

    CPAN: Storable loaded ok
    Going to read /root/.cpan/Metadata
      Database was generated on Tue, 24 Feb 2004 17:50:14 GMT
    Strange distribution name [CGI]Module id = CGI
        CPAN_USERID  LDS (Lincoln D. Stein <lstein@cshl.org>)
        CPAN_VERSION 3.04
        CPAN_FILE    L/LD/LDS/CGI.pm-3.04.tar.gz
        MANPAGE      CGI - Simple Common Gateway Interface Class
        INST_FILE    /usr/local/lib/perl5/5.6.1/CGI.pm
        INST_VERSION 2.89

Command Line

You can use perl from the command line to determine the module version.

    perl -M[modulename] -e 'print "$[modulename]::VERSION\n";'

For example:

    perl -MCGI -e 'print "$CGI::VERSION\n";'

This would produce something like:

    2.89

ActiveState (Windows)

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\";"

For example:

    perl -MCGI -e "print \"$CGI::VERSION\";"

ppm (Windows)

From your command line you can type 'ppm'. If you type in:

    query

ppm will display information about the modules installed. This does not include standard perl modules, so, for example,

    query CGI

will not return any data. However:

    query DBI

will return something like:

    DBI [1.14] Database independent interface for Perl
Revision: 1.2 Reviewed: S.T.

[Top]