There are a few ways. My favorite is to use:

perl -MCPAN -e autobundle

This will create a file (and display) all modules installed in the @INC paths,
as well as their versions. It also tells you the versions currently on the
CPAN. 

perldoc CPAN

for more information on the useful CPAN module.

You can also use a script to recurse through the directories in @INC:

#!/usr/bin/perl
use File::Find;
foreach $start (@INC) { find(\&modules, $start); }
# NOTES
#   1. Prune man, pod, etc. directories
#   2. Skip files with a suffix other than .pm
#   3. Format the filename so that it looks more like a module
#   4. Print it
sub modules {
    if (-d && /^[a-z]/) { $File::Find::prune = 1; return; }    # Note 1
    return unless /\.pm$/;                                     # Note 2
    my $filename = "$File::Find::dir/$_";
    $filename =~ s!^$start/!!;                                 # Note 3
    $filename =~ s!\.pm$!!;
    $filename =~ s!/!::!g;
    print "$filename\n";                                       # Note 4
}

Or, you can do (as seen on
http://www.cpan.org/misc/cpan-faq.html#How_installed_modules
):

perldoc perllocal

I generally use the 'autobundle', so I can quickly see how out of whack my
local modules are :)

Cheers,
Kevin


On Wed, Jun 13, 2001 at 11:17:10PM -0000, scott lutz ([EMAIL PROTECTED]) spew-ed 
forth:
> Is there a command to list all installed modules?
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
> 

-- 
[Writing CGI Applications with Perl - http://perlcgi-book.com]
All people have the right to be stupid, some people just abuse it!
        -- Frank Zappa

Reply via email to