Home > Perl > Module::Info – why didn’t I look for this eariler?

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…

About these ads
Categories: Perl Tags:
  1. March 15, 2011 at 10:20 am

    This totally needs to be part of perl core

  2. Karl Maria
    March 15, 2011 at 10:39 am

    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

  3. Siddhartha Basu
    March 15, 2011 at 5:16 pm

    pmvers from pmtools http://search.cpan.org/dist/pmtools is also worth looking at.

  4. Sawyer
    March 21, 2011 at 9:00 am
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: