perlfaq3: NEW ANSWER: How do I find which modules are installed on my system?

[email protected] (_brian_d_foy)
Newsgroups perl.perlfaq.workers,perl.documentation
Message-ID <101120021217551764%[email protected]>
* completely new answer.  added to perlfaq.pod too.

Index: perlfaq.pod
===================================================================
RCS file: /cvs/public/perlfaq/perlfaq.pod,v
retrieving revision 1.13
diff -u -d -r1.13 perlfaq.pod
--- perlfaq.pod 10 Nov 2002 17:35:47 -0000      1.13
+++ perlfaq.pod 10 Nov 2002 18:15:42 -0000
@@ -182,6 +182,10 @@
 
 =item *
 
+How do I find which modules are installed on my system?
+
+=item *
+
 How do I debug my Perl programs?
 
 =item *
Index: perlfaq3.pod
===================================================================
RCS file: /cvs/public/perlfaq/perlfaq3.pod,v
retrieving revision 1.28
diff -u -d -r1.28 perlfaq3.pod
--- perlfaq3.pod        30 Oct 2002 18:41:25 -0000      1.28
+++ perlfaq3.pod        10 Nov 2002 18:15:43 -0000
@@ -59,6 +59,34 @@
 from the source distribution is simplistic and uninteresting, but
 may still be what you want.
 
+=head2 How do I find which modules are installed on my system?
+
+You can use the ExtUtils::Installed module to show all
+installed distributions, although it can take awhile to do
+its magic.  The standard library which comes with Perl just
+shows up as "Perl" (although you can get those with
+Mod::CoreList).
+
+       use ExtUtils::Installed;
+
+       my $inst    = ExtUtils::Installed->new();
+       my @modules = $inst->modules();
+
+If you want a list of all of the Perl module filenames, you
+can use File::Find::Rule.
+
+       use File::Find::Rule;
+
+       my @files = File::Find::Rule->file()->name( '*.pm' )->in( @INC );
+
+If you simply need to quickly check to see if a module is
+available, you can check for its documentation.  If you can
+read the documentation the module is most likely installed. 
+If you cannot read the documentation, the module might not
+have any (in rare cases).
+
+       prompt% perldoc Module::Name
+
 =head2 How do I debug my Perl programs?
 
 Have you tried C<use warnings> or used C<-w>?  They enable warnings
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.