|
PERLWH.PL - a 'which' for Perl ModulesSYNOPSIS
perlwh.pl Long # Looks for .*Long.*\.pm
perlwh.pl -igno long # Looks for case insensitive .*long.*\.pm
perlwh.pl 'a.m' # Looks for "a + one char + m"
perlwh.pl -exactly DB # Looks for DB.pm
perlwh.pl -startswith DB # Looks for /^DM.+\.pm/
perlwh.pl -endswith DB # Looks for /DB\.pm$/
perlwh.pl . # Show all installed modules
DESCRIPTIONThis program can be used to show Perl modules available to your Perl installation. Sometimes you remember PART of the name of a module. You can use this program to show you all modules on your @INC path with the module name partially specified. This program was inspired by wh.pl which searches for executables on your PATH. This program should work on either Unix or DOS systems where Perl is installed. Use Perl regular expressions with a module name to find modules on @INC. Don't forget, you may need to escape special characters so the shell will not expand them. E.g. perlwh.pl 'l[fc]s' In addition to your normal @INC and $PERL5LIB path, the program will search additional paths you added to @add2inc at the top of the program. The default action is to show any module whose name contains the string you provide. For instance, 'perlwh.pl DB' would find all modules which have the characters 'DB' in the name (a surprisingly long list typically). This would include 'DBM.pm', 'TestPerlDB.pm', among others. On well-behaved systems, the following Perl program will show all the modules you have installed (from the Perl FAQ):
use ExtUtils::Installed;
my $instmod = ExtUtils::Installed->new();
foreach my $module ($instmod->modules()) {
my $version = $instmod->version($module) || "???";
print "$module -- $version\n";
}
exit;
The Perl module used here relies on .packlist files which SHOULD have been installed with each module. Unfortunately, we all to often live in a world of imperfect systems. The Debian Linux distribution, for instance, does NOT distribute the .packlist files. This script applies a much more heuristic approach to finding modules. It should find ALL your modules, but it may well find a few MORE than really exist (or may find some sort of duplicate). This program shows the modules installed for the Perl interpreter that is executing this script. If you have more than one perl binary, you can check each out by specifying the path to Perl explicitly, e.g. /usr/local/bin/perl terrys/pgms/perlwh.pl .
OPTIONS
PARAMETERS
EXITIf no fatal errors are detected, the program exits with a return code of 0.
AUTHORWritten by Terry Gliedt <tpg@hps.com> in 2004-2005 This is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; See http://www.gnu.org/copyleft/gpl.html |