Finding a Perl Module Version

How to find a perl module version

[Doc 8300 content is unavailable at this time.]

Simply type:

$ perl -MModule -e 'print "$Module::VERSION\n"'

For example, with Net::SSLeay:

$ perl -MNet::SSLeay -e 'print "$Net::SSLeay::VERSION\n"'

If you get an error like:

$ perl -MModule -e 'print "$Module::VERSION\n"'
Can't locate in @INC (@INC contains: 
/System/Library/Perl/5.8.6/darwin-thread-multi-2level /System/Library/Perl/5.8.6
/Library/Perl/5.8.6/darwin-thread-multi-2level /Library/Perl/5.8.6 /Library/Perl
/Network/Library/Perl/5.8.6 /Network/Library/Perl
/System/Library/Perl/Extras/5.8.6 /Library/Perl/5.8.1 .).
BEGIN failed--compilation aborted.

The module is not installed on your system

I (Jon Miner) wrote a handy shell script (perlmodver) to do this all for you. It accepts a Perl Module as an argument. If $PERL is defined, it is used instead of simply perl. Sample usage:

$ perlmodver Net::SSLeay
Net::SSLeay: 1.25
$ env PERL=/usr/bin/perl perlmodver Net::SSLeay
Net::SSLeay: 1.20

perlmodver source:



if test "x$mod" = "x"; then
    echo "Usage: $0 <module>"

if test "x$PERL" = "x"; then

$PERL -M$mod -e "print \"$mod: \$$mod::VERSION\n\""

Keywordsperl module version   Doc ID4222
OwnerMST SupportGroupIdentity and Access Management
Created2005-11-28 18:00:00Updated2023-08-10 08:37:07
SitesIdentity and Access Management
Feedback  0   0