Module::Info – why didn’t I look for this eariler?
Just a quick post in praise of Module::Info. I often find myself wanting to know the version or location of a CPAN module installed on a particular system. Too often, I end up doing:
perl -MSome::Module -le "print $Some::Module::VERSION"
and/or:
perl -MSome::Module -le "print $INC{'Some/Module.pm'}"
Quite cumbersome and verbose. I’ve often thought someone could easily write a script to provide this, and even wondered if I should do this myself. The urge to scratch that itch has never become overpowering enough, however.
Today, though, I decided I should actually see if someone had already done it. It took all of 2 seconds to turn up Module::Info, which comes with a command line tool. I can now write the above commands as:
module_info Some::Module
It even tells me if it’s a core module, and can display its dependencies with the right command line parameters. Even better, there are packages for Debian and Ubuntu. What more could I ask for?
So Module::Info++, and now I have to start wondering why I didn’t take the time to look for this tool some time ago…
This totally needs to be part of perl core
Very nice, thanks for the hint.
Btw, a fast and easy way to estimate the version:
perl
use Test::Most 9;
Test::Most version 9 required–this is only version 0.21 at – line 1.
Regards
pmvers from pmtools http://search.cpan.org/dist/pmtools is also worth looking at.
Check this blog post about Module::Version.