ytzk5q
Last Updated: February 25, 2016
·
1.604K
· ksi
B451817e013f2084e84990d7b7d36b21

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
Say Thanks
Respond
Filed Under