Contents
whichpm
is a cross-platform CLI that locates installed Perl modules,
and optionally reports information about them, including detection of accidental duplicates.
Analogous to how the common which
Unix utility locates binaries by their filename,
whichpm
locates Perl modules by their module (package) name.
# Locate the Data::Dumper module.
$ whichpm Data::Dumper
/usr/lib/perl/5.18/Data/Dumper.pm
# Locate the Data::Dumper module, and also print
# version information and core-module status.
$ whichpm -v Data::Dumper
Data::Dumper 2.145 core>=5.005 /usr/lib/perl/5.18/Data/Dumper.pm
# Locate the Data::Dumper module and open it in your system's default text
# editor.
$ whichpm -e Data::Dumper
# Look for accidental duplicates of the Foo::Bar module.
# Normally, only 1 path should be returned.
$ whichpm -a Foo::Bar
/usr/lib/perl/5.18/Foo/Bar.pm
./Foo/Bar.pm
# Print the paths of all installed modules.
$ whichpm -a
Supported platforms and prerequisites
Linux, macOS, and Windows, with Perl v5.4.50 or higher installed.
Note: Even if you don't use Node.js, its package manager, npm
, works across platforms and is easy to install with curl -L http://git.io/n-install | bash
With Node.jsinstalled, install the package as follows:
[sudo] npm install whichpm -g
Note:
sudo
depends on how you installed Node.js and whether you've changed permissions later; if you get an EACCES
error, try again with sudo
.-g
ensures global installation and is needed to put whichpm
in your system's $PATH
.whichpm
.chmod +x whichpm
.$PATH
, such as /usr/local/bin
(macOS) or /usr/bin
(Linux).Find brief usage information below; for complete documentation, run whichpm --man
or read the manual online.
$ whichpm --help
Prints the filesystem paths of the specified Perl modules, if installed.
whichpm [-v] [-q] [-e] <module_name>...
whichpm -a [-v] [-q] [-e] [<module_name>...]
-a ... lists all installed module files / all module files matching
the specified name(s) (checks for accidental duplicates)
-v ... verbose mode: also prints name, version, core-module status
-q ... suppresses warnings
-e ... opens modules in default text editor
Standard options: --help, --man, --version, --home
Copyright (c) 2020 Michael Klement [email protected] (http://same2u.net), released under the MIT license.
This project gratefully depends on the following open-source components, according to the terms of their respective licenses.
npm dependencies below have optional suffixes denoting the type of dependency; the absence of a suffix denotes a required run-time dependency: (D)
denotes a development-time-only dependency, (O)
an optional dependency, and (P)
a peer dependency.
Versioning complies with semantic versioning (semver).
v0.2.0 (2020-01-14):
-q
).v0.1.8 (2020-01-14):
v0.1.7 (2015-09-16):
v0.1.6 (2015-09-16):
v0.1.5 (2015-09-15):
v0.1.4 (2015-09-03):
v0.1.3 (2015-09-02):
v0.1.2 (2015-09-02):
-h
/ --help
option.v0.1.1 (2015-09-02):
man whichpm
should now work on Linux and OSX.v0.1.0 (2015-09-01):