Monday, January 3, 2011

Checking Installed Perl Module Versions



To check the version number of an installed Perl module from the command line, use the following one-liner template:

Bash
perl -M<Module> -e 'print "<Module>::VERSION\n"'


Examples

  • Check the version of the CGI module:

    Bash
    perl -MCGI -e 'print "$CGI::VERSION\n"'
    
  • Check the version of Data::Dumper:

    Bash
    perl -MData::Dumper -e 'print "$Data::Dumper::VERSION\n"'
    


Alternative Methods

  1. Using CPAN:

    Bash
    cpan -m CGI
    
  2. Using Corelist (for core modules):
    Bash
    corelist CGI
    

No comments: