version info of package modules

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I am in the midst of a software audit of all of our perl pacakges.
Some pacakges installed compnay wide are older than others. What I want
to know is the version of a given pacakge. I know I can type perl -v
and get the current release of the perl interpreter. But I would like
to get the version string for a package, like SNMP.

Thanks in advance!


Re: version info of package modules

On 26 Apr 2005, wrote:

Quoted text here. Click to load it

You may want to try using the CPAN shell; it has commands to show the
version number of installed modules, the version number of the latest
CPAN modules, and a list recommending modules for reinstall:

$ perl -MCPAN -e shell

cpan> m SNMP

Module id = SNMP
    DESCRIPTION  Interface to the UCD SNMP toolkit
    CPAN_FILE    G/GS/GSM/SNMP-4.2.0.tar.gz
    DSLI_STATUS  RdcO (released,developer,C,object-oriented)
    INST_FILE    (not installed)

cpan> r

Package namespace         installed    latest  in CPAN file
B::Utils                    0.04_01      0.05  J/JJ/JJORE/B-Utils-0.05.tar.gz
CGI                            3.05      3.07  L/LD/LDS/
Class::ISA                     0.32      0.33  S/SB/SBURKE/Class-ISA-0.33.tar.gz

Hope this helps,

Re: version info of package modules

* schrieb:

Quoted text here. Click to load it

It is common that each published package has a var named $VERSION but
it's not preinstructed. Try to print out this var for your module like:

    use SNMP;
    print $SNMP::VERSION;

The current SNMP package (from CPAN) yields '4.2.0' when executing this
print-statement. Sure, this could be done in the shell too.

    $ perl -MSNMP -e'print $SNMP::VERSION'


Site Timeline