Finding a Perl Module Version

How to find a perl module version

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

Keywords:perl module version   Doc ID:4222
Owner:MST Support .Group:Identity and Access Management
Created:2005-11-28 19:00 CDTUpdated:2022-05-25 15:15 CDT
Sites:Identity and Access Management
Feedback:  0   0