perl -MExtUtils::Installed -E 'say for ExtUtils::Installed->new()->modules()'

Print a list of installed Perl modules

Lists all the modules that were installed the "proper way". It also uses Perl 5.10(or higher)'s say command for less typing.
Sample Output
Algorithm::Diff
Algorithm::NaiveBayes
Alien::Judy
Alien::wxWidgets
Any::Moose
App::FatPacker
App::Nopaste
App::cpanminus
App::perlbrew
AppConfig
Archive::Any
Archive::Extract
Archive::Tar
Archive::Zip
Array::Diff
Array::Iterator
Array::RefElem
Async

0
By: kimmel
2011-11-16 17:26:47

3 Alternatives + Submit Alt

  • Works only if modules are installed "the right way"


    6
    perl -MExtUtils::Installed -e '$inst = ExtUtils::Installed->new(); @modules = $inst->modules(); print join("\n", @modules);'
    braak · 2010-07-20 15:47:32 1
  • This version works on an AIX system on which I have very limited permissions. The other version fails with "Can't open file /usr/opt/perl588/lib/site_perl/5.8.8/aix/auto/DBI/.packlist".


    2
    perl -MFile::Find=find -MFile::Spec::Functions -Tlwe 'find { wanted => sub { print canonpath $_ if /\.pm\z/ }, no_chdir => 1 }, @INC'
    randy909 · 2010-08-02 15:18:51 0
  • IMVHO if you are using cpan to install perl modules you are doing it wrong. Show Sample Output


    -5
    dpkg-query -W | grep perl
    unixmonkey10924 · 2010-07-20 16:14:04 1

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: