Perl Command To List Installed CPAN Modules

How can I display a list of all installed CPAN / Perl modules under Unix like operating systems?

There are various ways to list all installed Perl / CPAN modules under Unix, Linux, and MS-Windows operating systems.

Method #1: instmodsh (Debian and friends)

A little interface to ExtUtils::Installed to examine locally installed modules, validate your packlists and even create a tarball from an installed module. Type the following command
$ instmodsh
Sample outputs:

Available commands are:
   l            - List all installed modules
   m    - Select a module
   q            - Quit the program

To list all installed modules, type l:

cmd? l

Sample outputs:

Installed modules are:

Method #2 ExtUtils::Installed module

Inside a Perl program, you can use the ExtUtils::Installed module to show all installed distributions. Create a program called

#!/usr/bin/perl -w
use ExtUtils::Installed;
my $inst    = ExtUtils::Installed->new();
my @modules = $inst->modules();
 foreach $module (@modules){
      print $module . "n";

Run the program as follows:
$ chmod +x

Sample outputs:


Method #3: cpan command

Type the following command:
$ cpan -l

Method #4: ActivePerl

ActivePerl has the PPM utility:
ppm query

Posted by: SXI ADMIN

The author is the creator of SXI LLC and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post

How to Make Website WCAG Compliant?

Next Post

Link download Kali Linux 2020.1 (ISO + Torrent)

Related Posts