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.


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

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

    [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

Using MTS MBlaze on Mint Linux 14 / Ubuntu 12.04