How to check Perl Module version in Linux

Q: How to check installed perl module version on linux ?

On terminal type following command, replace <module_name> with your perl module.

    #perl -M<module_name> -e "print \"$1: \$<module_name>::VERSION\n\""


Further you can create a simple bash script which accepts module name as input in first positional parameter.

#!/bin/bash

if [ x$1 == "x" ]
then
        echo "Usage: $0 <Module>"
else
        perl -M$1 -e "print \"$1: \$$1::VERSION\n\""
fi

Save it, lets say as "perlv.sh" or "perlv", provide executable permission and kept it under "/usr/bin" or wherever you wish, then you can use it as handy command.

Eg:
    [root@linuxskool root]# perlv JSON::Any
                         JSON::Any: 1.16

Popular posts from this blog

Grsecurity: Configure RHEL5/6 Kernel for Grsecurity

Linux Command line tips and Bash stuff