1PM_WHICH(1)           User Contributed Perl Documentation          PM_WHICH(1)
2
3
4

NAME

6       pm_which - find installed modules
7

SYNOPSIS

9           pm_which [ options ] module(s)
10
11           Returns the path to the given module(s)
12
13   OPTIONS
14           -q, --quiet     Just print paths
15           -p, --paths     Just convert the module name into a relative path
16           -a, --all       Print all paths, not just the first one found
17           -n, --namespace Print all modules in the given namespace
18           -m              Only print module names, not paths
19           -V              Show module version
20           -I libpath      Add a path to search (like perl -I)
21           -d, --dump      Dump paths that would be searched (@INC by default)
22           -h, --help      Print this message
23           -v, --version   Print version information
24           -               Read modules from stdin, one per line
25

DESCRIPTION

27       This tool reports the locations of installed perl modules.
28
29       By default it lists the location of each specified module that would be
30       loaded by require.
31

OPTION DETAILS

33   quiet
34       Under quiet mode, module names are suppressed and missing modules are
35       not reported.
36
37       Normal output:
38
39           $ pm_which Module::One Module::Two Missing::Module
40           Module::One     - /path/to/Module/One.pm
41           Module::Two     - /path/to/Module/Two.pm
42           Missing::Module - not found
43
44       Under --quiet:
45
46           $ pm_which -q Module::One Module::Two Missing::Module
47           /path/to/Module/One.pm
48           /path/to/Module/Two.pm
49
50   paths
51       In "paths" mode, each module is simply converted into a relative file
52       path. This is possible even when the module is not installed.
53
54           $ pm_which -p Missing::Module
55           Missing/Module.pm
56
57   all
58       When the "all" switch is specified, all installed modules will be
59       reported, not just the first one. This is useful for determining when
60       there is a module installed in multiple locations.
61
62           $ pm_which -a MyModule
63           /path/to/MyModule.pm
64           /home/me/perl/MyModule.pm
65
66   namespace
67       Arguments are taken as namespaces to search under.
68
69           $ pm_which -n MyModule
70           MyModule            - /path/to/MyModule.pm
71           MyModule::Foo       - /path/to/MyModule/Foo.pm
72           MyModule::Foo::Bar  - /path/to/MyModule/Foo/Bar.pm
73
74   -m
75       Disables printing of module paths. This is only really useful in
76       conjunction with --namespace.
77
78           $ pm_which -nm MyModule
79           MyModule
80           MyModule::Foo
81           MyModule::Foo::Bar
82
83   -V
84       Prints the version of each module, according to ExtUtils::MakeMaker.
85
86           $ pm_which -V MyModule
87           MyModule - /path/to/MyModule.pm [ 1.00 ]
88
89           $ pm_which -Vnm MyModule
90           MyModule [ 1.00 ]
91           MyModule::Foo [ 0.01 ]
92           MyModule::Foo::Bar [ undef ]
93
94   dump
95       Dumps the paths that would be searched and exits. This is @INC modified
96       by any -I switches.
97
98           $ pm_which --dump
99           /usr/lib/perl5/site_perl/5.8.6
100           /usr/lib/perl5/vendor_perl/5.8.6
101           ...
102
103           $ pm_which -I lib --dump -I blib/lib
104           lib
105           blib/lib
106           /usr/lib/perl5/site_perl/5.8.6
107           ...
108
109   version
110       Prints the version number of the script, plus the version and path of
111       Module::Util that was loaded.
112

EXIT CODES

114       ·   0 - Everything was OK
115
116       ·   1 - Initialisation failed (bad switches?)
117
118       ·   2 - Some modules were not installed
119

SEE ALSO

121       This utility comes with Module::Util.
122

AUTHOR

124       Matt Lawrence <mattlaw@cpan.org>
125
126
127
128perl v5.32.0                      2020-07-28                       PM_WHICH(1)
Impressum