-   Linux - General (
-   -   How to list all installed Perl modules (

SharpyWarpy 08-12-2004 05:49 AM

How to list all installed Perl modules
How do I list all the Perl modules installed in my machine? I know perl -l 'use Module::Name;print"okay"' will tell me about
a particular module, but I want a complete list, so I can maybe redirect
it's output to a file.

SharpyWarpy 08-12-2004 07:41 AM

perl -MFile::Find=find -MFile::Spec::Functions -Tlwe \
'find { wanted => sub { print canonpath $_ if /\.pm\z/ }, no_chdir => 1 }, @INC'

rose_bud4201 08-25-2004 10:14 AM

I had the same question, and this works wonderfully - thanks for posting your solution!


kpramod 09-01-2009 01:56 AM

Perl: query about the module installed
Use command to check for Net::Ping module installed:

perl -MNet::Ping -e "print \"Module installed.\\n\";"

here Net is package name and Ping is module name under package Net.

'Module installed.' message will be displayed if Package::Module installed.

You can try
perl -MNet::Ping -e 1
If you get error message immediately then the module not installed!

queengeek 09-03-2009 03:44 PM

I had to register here just so I could say thanks for the command to pull out all installed perl modules.

Very nice indeed. Thank you again!

linuxcares12 09-20-2009 03:20 PM

Use the following command and type "l" in the prompt to list all installed perl modules.



Rooth 10-05-2009 06:12 PM

And another thanks from me. This just addressed a problem in like 30 seconds. All hail LQ (and google)!

++nick++ 01-02-2010 09:54 PM


Originally Posted by SharpyWarpy (Post 1104292)
perl -MFile::Find=find -MFile::Spec::Functions -Tlwe \
'find { wanted => sub { print canonpath $_ if /\.pm\z/ }, no_chdir => 1 }, @INC'

Works great , thanks

But I have a question , in WindowsXP (active perl 5.8) command "perldoc perllocal" works , but in linux it doesnt , any reason for this.

One more way to find is,

$ instmodsh

cmd? l

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

cmd? l

Installed modules are:

cmd? m perl

Available commands are:
f [all|prog|doc] - List installed files of a given type
d [all|prog|doc] - List the directories used by a module
v - Validate the .packlist - check for missing files
t <tarfile> - Create a tar archive of the module
h - Display module help
q - Quit the module

perl cmd? f

Outputs all the installed modules

angel115 12-12-2011 04:48 AM

For reference you can use this as well:

Which give this output:

Crypt::Blowfish (2.12) - Perl Blowfish encryption module
Crypt::DES (2.05) - Perl DES encryption module
Math::PariInit - load C<Math::Pari> with specified $primelimit and $initmem.
Math::Pari (2.01080605) - Perl interface to PARI.
Time::HiRes (1.9721) - High resolution alarm, sleep, gettimeofday, interval timers
Digest::SHA1 (2.13) - Perl interface to the SHA-1 algorithm
Digest::MD2 (2.03) - Perl interface to the MD2 Algorithm
YAML (0.73) - YAML Ain't Markup Language (tm)
CPAN::Meta (2.112621) - the distribution metadata for a CPAN dist

I usually include a text file containing the output of this command to my backups, this will help a lot in case of disaster recovery.

All times are GMT -5. The time now is 09:14 AM.