查看已经安装的Perl模块

  • 单行程序

1
find `perl -e 'print "@INC"'` -name '*.pm' -print
  • Perl脚本

1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/perl
use strict;
use ExtUtils::Installed;
 
my $inst    = ExtUtils::Installed->new();
my @modules = $inst->modules();
 
foreach (@modules) {
my $ver = $inst->version($_) || "???";
printf( "%-12s --  %sn", $_, $ver );
}
exit 0;