Printable Version of Topic

Click here to view this topic in its original format

Linuxhelp _ Tips and Tricks _ Listing Perl Modules Installed

Posted by: Corey Dec 19 2003, 12:50 AM

Thanks to hughesjr for this tip:

Add this code to a file (I named it

#!/usr/bin/perl -w

use strict;
use CGI qw/:standard/;
use File::Find;

print header,
h1("Perl Environment: $ENV{SERVER_NAME}"),
p("Perl Version: $]"),
p(" Version: $CGI::VERSION"),
p("Library Path (\@INC):"),

foreach my $dir (@INC) {
my @mods;
find(sub { push @mods, $File::Find::name if /\.pm$/ }, $dir);
print ul(li("$dir"), ul(li([sort @mods])));

Then run it like this:

perl > list_mods.html

Open list_mods.html with your web browser...

Powered by Invision Power Board (
© Invision Power Services (