Debian Codegraph @

upstream/opensuse-tumbleweed/man3/ExtUtils::Installed.3pm

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\"
56 .\" Required to disable full justification in groff 1.23.0.
57 .if n .ds AD l
58 .\" ========================================================================
59 .\"
60 .IX Title "ExtUtils::Installed 3pm"
61 .TH ExtUtils::Installed 3pm 2026-03-09 "perl v5.42.1" "Perl Programmers Reference Guide"
62 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
63 .\" way too many mistakes in technical documents.
64 .if n .ad l
65 .nh
66 .SH NAME
67 ExtUtils::Installed \- Inventory management of installed modules
68 .SH SYNOPSIS
69 .IX Header "SYNOPSIS"
70 .Vb 9
71 \& use ExtUtils::Installed;
72 \& my ($inst) = ExtUtils::Installed\->new( skip_cwd => 1 );
73 \& my (@modules) = $inst\->modules();
74 \& my (@missing) = $inst\->validate("DBI");
75 \& my $all_files = $inst\->files("DBI");
76 \& my $files_below_usr_local = $inst\->files("DBI", "all", "/usr/local");
77 \& my $all_dirs = $inst\->directories("DBI");
78 \& my $dirs_below_usr_local = $inst\->directory_tree("DBI", "prog");
79 \& my $packlist = $inst\->packlist("DBI");
80 .Ve
81 .SH DESCRIPTION
82 .IX Header "DESCRIPTION"
83 ExtUtils::Installed provides a standard way to find out what core and module
84 files have been installed. It uses the information stored in .packlist files
85 created during installation to provide this information. In addition it
86 provides facilities to classify the installed files and to extract directory
87 information from the .packlist files.
88 .SH USAGE
89 .IX Header "USAGE"
90 The \fBnew()\fR function searches for all the installed .packlists on the system, and
91 stores their contents. The .packlists can be queried with the functions
92 described below. Where it searches by default is determined by the settings found
93 in \f(CW%Config::Config\fR, and what the value is of the PERL5LIB environment variable.
94 .SH METHODS
95 .IX Header "METHODS"
96 Unless specified otherwise all method can be called as class methods, or as object
97 methods. If called as class methods then the "default" object will be used, and if
98 necessary created using the current processes \f(CW%Config\fR and \f(CW@INC\fR. See the
99 \&\*(Aqdefault\*(Aq option to \fBnew()\fR for details.
100 .IP \fBnew()\fR 4
101 .IX Item "new()"
102 This takes optional named parameters. Without parameters, this
103 searches for all the installed .packlists on the system using
104 information from \f(CW%Config::Config\fR and the default module search
105 paths \f(CW@INC\fR. The packlists are read using the
106 ExtUtils::Packlist module.
107 .Sp
108 If the named parameter \f(CW\*(C`skip_cwd\*(C'\fR is true, the current directory \f(CW\*(C`.\*(C'\fR will
109 be stripped from \f(CW@INC\fR before searching for .packlists. This keeps
110 ExtUtils::Installed from finding modules installed in other perls that
111 happen to be located below the current directory.
112 .Sp
113 If the named parameter \f(CW\*(C`config_override\*(C'\fR is specified,
114 it should be a reference to a hash which contains all information
115 usually found in \f(CW%Config::Config\fR. For example, you can obtain
116 the configuration information for a separate perl installation and
117 pass that in.
118 .Sp
119 .Vb 3
120 \& my $yoda_cfg = get_fake_config(\*(Aqyoda\*(Aq);
121 \& my $yoda_inst =
122 \& ExtUtils::Installed\->new(config_override=>$yoda_cfg);
123 .Ve
124 .Sp
125 Similarly, the parameter \f(CW\*(C`inc_override\*(C'\fR may be a reference to an
126 array which is used in place of the default module search paths
127 from \f(CW@INC\fR.
128 .Sp
129 .Vb 3
130 \& use Config;
131 \& my @dirs = split(/\eQ$Config{path_sep}\eE/, $ENV{PERL5LIB});
132 \& my $p5libs = ExtUtils::Installed\->new(inc_override=>\e@dirs);
133 .Ve
134 .Sp
135 \&\fBNote\fR: You probably do not want to use these options alone, almost always
136 you will want to set both together.
137 .Sp
138 The parameter \f(CW\*(C`extra_libs\*(C'\fR can be used to specify \fBadditional\fR paths to
139 search for installed modules. For instance
140 .Sp
141 .Vb 2
142 \& my $installed =
143 \& ExtUtils::Installed\->new(extra_libs=>["/my/lib/path"]);
144 .Ve
145 .Sp
146 This should only be necessary if \fI/my/lib/path\fR is not in PERL5LIB.
147 .Sp
148 Finally there is the \*(Aqdefault\*(Aq, and the related \*(Aqdefault_get\*(Aq and \*(Aqdefault_set\*(Aq
149 options. These options control the "default" object which is provided by the
150 class interface to the methods. Setting \f(CW\*(C`default_get\*(C'\fR to true tells the constructor
151 to return the default object if it is defined. Setting \f(CW\*(C`default_set\*(C'\fR to true tells
152 the constructor to make the default object the constructed object. Setting the
153 \&\f(CW\*(C`default\*(C'\fR option is like setting both to true. This is used primarily internally
154 and probably isn\*(Aqt interesting to any real user.
155 .IP \fBmodules()\fR 4
156 .IX Item "modules()"
157 This returns a list of the names of all the installed modules. The perl \*(Aqcore\*(Aq
158 is given the special name \*(AqPerl\*(Aq.
159 .IP \fBfiles()\fR 4
160 .IX Item "files()"
161 This takes one mandatory parameter, the name of a module. It returns a list of
162 all the filenames from the package. To obtain a list of core perl files, use
163 the module name \*(AqPerl\*(Aq. Additional parameters are allowed. The first is one
164 of the strings "prog", "doc" or "all", to select either just program files,
165 just manual files or all files. The remaining parameters are a list of
166 directories. The filenames returned will be restricted to those under the
167 specified directories.
168 .IP \fBdirectories()\fR 4
169 .IX Item "directories()"
170 This takes one mandatory parameter, the name of a module. It returns a list of
171 all the directories from the package. Additional parameters are allowed. The
172 first is one of the strings "prog", "doc" or "all", to select either just
173 program directories, just manual directories or all directories. The remaining
174 parameters are a list of directories. The directories returned will be
175 restricted to those under the specified directories. This method returns only
176 the leaf directories that contain files from the specified module.
177 .IP \fBdirectory_tree()\fR 4
178 .IX Item "directory_tree()"
179 This is identical in operation to \fBdirectories()\fR, except that it includes all the
180 intermediate directories back up to the specified directories.
181 .IP \fBvalidate()\fR 4
182 .IX Item "validate()"
183 This takes one mandatory parameter, the name of a module. It checks that all
184 the files listed in the modules .packlist actually exist, and returns a list of
185 any missing files. If an optional second argument which evaluates to true is
186 given any missing files will be removed from the .packlist
187 .IP \fBpacklist()\fR 4
188 .IX Item "packlist()"
189 This returns the ExtUtils::Packlist object for the specified module.
190 .IP \fBversion()\fR 4
191 .IX Item "version()"
192 This returns the version number for the specified module.
193 .SH EXAMPLE
194 .IX Header "EXAMPLE"
195 See the example in ExtUtils::Packlist.
196 .SH AUTHOR
197 .IX Header "AUTHOR"
198 Alan Burlison <[email protected]>