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.
Tutorial details
Difficulty level Easy
Root privileges No
Requirements Perl
Est. reading time N/A

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

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 2 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersncdu pydf
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
2 comments… add one
  • Rika Jan 27, 2014 @ 18:37

    Thank you for the help! It is greatly appreciated!

  • Anand Dec 14, 2016 @ 14:58

    How to list all sub functions for a particular perl modules?

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum