Last Updated: February 25, 2016
·
1.886K
· ksi

Check installed version of a perl module

Add the function to your bash-profile (it's one line starting with perl):

function perlver {
    lib=${1//::/\/}
    perl -e "use $1; printf(\"%s\n\tPath:   %s\n\tVersion: %s\n\", '$1', \$INC{'$lib.pm'}, \$$1::VERSION);" 2>/dev/null || echo "$1 is not installed"
}

And run (for any module, e.g. List::Util)

perlver List::Util