Wednesday, September 05, 2007

Script to List Installed Perl Modules


On the CPAN site, there’s a script that lists what modules are installed in your perl path:
http://www.cpan.org/misc/cpan-faq.html#How_installed_modules

Here’s the script... (Of course, you’ll have to modify /usr/local/bin/perl to whatever the path for your perl deployment is in)

#!/usr/local/bin/perl

use ExtUtils::Installed;
my $instmod = ExtUtils::Installed->new();
foreach my $module ($instmod->modules()) {
my $version = $instmod->version($module) || "???";
      print "$module -- $version\n";
}

0 comments: