How can I find the version of an installed Perl module?

Drew Stephens picture Drew Stephens · Sep 25, 2008 · Viewed 60.2k times · Source

How do you find the version of an installed Perl module?

This is in an answer down at the bottom, but I figure it important enough to live up here. With these suggestions, I create a function in my .bashrc

function perlmodver {
    perl -M$1 -e 'print "Version " . $ARGV[0]->VERSION . " of " . $ARGV[0] . \
    " is installed.\n"' $1
}

Answer

zigdon picture zigdon · Sep 25, 2008

Most modules (especially ones from The CPAN) have a $VERSION variable:

perl -MSome::Module -le 'print $Some::Module::VERSION'