How do I get a list of installed CPAN modules?

2019-01-12 17:30发布

Aside from trying

perldoc <module name>

individually for any CPAN module that takes my fancy or going through the file system and looking at the directories I have no idea what modules we have installed.

What's the easiest way to just get a big list of every CPAN module installed? From the command line or otherwise.

标签: perl cpan
27条回答
【Aperson】
2楼-- · 2019-01-12 17:56

perldoc -q installed

claims that cpan -l will do the trick, however it's not working for me. The other option:

cpan -a

does spit out a nice list of installed packages and has the nice side effect of writing them to a file.

查看更多
ら.Afraid
3楼-- · 2019-01-12 17:56

Here a script which would do the trick:

 use ExtUtils::Installed;

 my $inst = ExtUtils::Installed->new();
 my @modules = $inst->modules();
 foreach $module (@modules){
        print $module ." - ". $inst->version($module). "\n";
 }

=head1 ABOUT

This scripts lists installed cpan modules using the ExtUtils modules

=head1 FORMAT

Prints each module in the following format
<name> - <version>

=cut
查看更多
老娘就宠你
4楼-- · 2019-01-12 17:56

the Perl cookbook contains several iterations of a script "pmdesc" that does what you want. Google-search for "Perl Cookbook pmdesc" and you'll find articles on other Q&A Sites, several code listings on the net, a discussion of the solution, and even some refinements.

查看更多
劫难
5楼-- · 2019-01-12 18:01

You can get list of perl modules installed in you system by using instmodsh command in your terminal.It will ask you three option in order to enhance the output they are:

   l            - List all installed modules
   m <module>   - Select a module
   q            - Quit the program
查看更多
做自己的国王
6楼-- · 2019-01-12 18:01

Try the following command

instmodsh

查看更多
够拽才男人
7楼-- · 2019-01-12 18:01

For Linux the easiest way to get is,

dpkg -l | grep "perl"
查看更多
登录 后发表回答