Debian Codegraph @

upstream/debian-unstable/man3/ExtUtils::Installed.3perl

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man 5.0102 (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 .\"
57 .IX Title "ExtUtils::Installed 3perl"
58 .TH ExtUtils::Installed 3perl 2025-11-16 "perl v5.40.1" "Perl Programmers Reference Guide"
59 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
60 .\" way too many mistakes in technical documents.
61 .if n .ad l
62 .nh
63 .SH NAME
64 ExtUtils::Installed \- Inventory management of installed modules
65 .SH SYNOPSIS
66 .IX Header "SYNOPSIS"
67 .Vb 9
68 \& use ExtUtils::Installed;
69 \& my ($inst) = ExtUtils::Installed\->new( skip_cwd => 1 );
70 \& my (@modules) = $inst\->modules();
71 \& my (@missing) = $inst\->validate("DBI");
72 \& my $all_files = $inst\->files("DBI");
73 \& my $files_below_usr_local = $inst\->files("DBI", "all", "/usr/local");
74 \& my $all_dirs = $inst\->directories("DBI");
75 \& my $dirs_below_usr_local = $inst\->directory_tree("DBI", "prog");
76 \& my $packlist = $inst\->packlist("DBI");
77 .Ve
78 .SH DESCRIPTION
79 .IX Header "DESCRIPTION"
80 ExtUtils::Installed provides a standard way to find out what core and module
81 files have been installed. It uses the information stored in .packlist files
82 created during installation to provide this information. In addition it
83 provides facilities to classify the installed files and to extract directory
84 information from the .packlist files.
85 .SH USAGE
86 .IX Header "USAGE"
87 The \fBnew()\fR function searches for all the installed .packlists on the system, and
88 stores their contents. The .packlists can be queried with the functions
89 described below. Where it searches by default is determined by the settings found
90 in \f(CW%Config::Config\fR, and what the value is of the PERL5LIB environment variable.
91 .SH METHODS
92 .IX Header "METHODS"
93 Unless specified otherwise all method can be called as class methods, or as object
94 methods. If called as class methods then the "default" object will be used, and if
95 necessary created using the current processes \f(CW%Config\fR and \f(CW@INC\fR. See the
96 \&'default' option to \fBnew()\fR for details.
97 .IP \fBnew()\fR 4
98 .IX Item "new()"
99 This takes optional named parameters. Without parameters, this
100 searches for all the installed .packlists on the system using
101 information from \f(CW%Config::Config\fR and the default module search
102 paths \f(CW@INC\fR. The packlists are read using the
103 ExtUtils::Packlist module.
104 .Sp
105 If the named parameter \f(CW\*(C`skip_cwd\*(C'\fR is true, the current directory \f(CW\*(C`.\*(C'\fR will
106 be stripped from \f(CW@INC\fR before searching for .packlists. This keeps
107 ExtUtils::Installed from finding modules installed in other perls that
108 happen to be located below the current directory.
109 .Sp
110 If the named parameter \f(CW\*(C`config_override\*(C'\fR is specified,
111 it should be a reference to a hash which contains all information
112 usually found in \f(CW%Config::Config\fR. For example, you can obtain
113 the configuration information for a separate perl installation and
114 pass that in.
115 .Sp
116 .Vb 3
117 \& my $yoda_cfg = get_fake_config(\*(Aqyoda\*(Aq);
118 \& my $yoda_inst =
119 \& ExtUtils::Installed\->new(config_override=>$yoda_cfg);
120 .Ve
121 .Sp
122 Similarly, the parameter \f(CW\*(C`inc_override\*(C'\fR may be a reference to an
123 array which is used in place of the default module search paths
124 from \f(CW@INC\fR.
125 .Sp
126 .Vb 3
127 \& use Config;
128 \& my @dirs = split(/\eQ$Config{path_sep}\eE/, $ENV{PERL5LIB});
129 \& my $p5libs = ExtUtils::Installed\->new(inc_override=>\e@dirs);
130 .Ve
131 .Sp
132 \&\fBNote\fR: You probably do not want to use these options alone, almost always
133 you will want to set both together.
134 .Sp
135 The parameter \f(CW\*(C`extra_libs\*(C'\fR can be used to specify \fBadditional\fR paths to
136 search for installed modules. For instance
137 .Sp
138 .Vb 2
139 \& my $installed =
140 \& ExtUtils::Installed\->new(extra_libs=>["/my/lib/path"]);
141 .Ve
142 .Sp
143 This should only be necessary if \fI/my/lib/path\fR is not in PERL5LIB.
144 .Sp
145 Finally there is the 'default', and the related 'default_get' and 'default_set'
146 options. These options control the "default" object which is provided by the
147 class interface to the methods. Setting \f(CW\*(C`default_get\*(C'\fR to true tells the constructor
148 to return the default object if it is defined. Setting \f(CW\*(C`default_set\*(C'\fR to true tells
149 the constructor to make the default object the constructed object. Setting the
150 \&\f(CW\*(C`default\*(C'\fR option is like setting both to true. This is used primarily internally
151 and probably isn't interesting to any real user.
152 .IP \fBmodules()\fR 4
153 .IX Item "modules()"
154 This returns a list of the names of all the installed modules. The perl 'core'
155 is given the special name 'Perl'.
156 .IP \fBfiles()\fR 4
157 .IX Item "files()"
158 This takes one mandatory parameter, the name of a module. It returns a list of
159 all the filenames from the package. To obtain a list of core perl files, use
160 the module name 'Perl'. Additional parameters are allowed. The first is one
161 of the strings "prog", "doc" or "all", to select either just program files,
162 just manual files or all files. The remaining parameters are a list of
163 directories. The filenames returned will be restricted to those under the
164 specified directories.
165 .IP \fBdirectories()\fR 4
166 .IX Item "directories()"
167 This takes one mandatory parameter, the name of a module. It returns a list of
168 all the directories from the package. Additional parameters are allowed. The
169 first is one of the strings "prog", "doc" or "all", to select either just
170 program directories, just manual directories or all directories. The remaining
171 parameters are a list of directories. The directories returned will be
172 restricted to those under the specified directories. This method returns only
173 the leaf directories that contain files from the specified module.
174 .IP \fBdirectory_tree()\fR 4
175 .IX Item "directory_tree()"
176 This is identical in operation to \fBdirectories()\fR, except that it includes all the
177 intermediate directories back up to the specified directories.
178 .IP \fBvalidate()\fR 4
179 .IX Item "validate()"
180 This takes one mandatory parameter, the name of a module. It checks that all
181 the files listed in the modules .packlist actually exist, and returns a list of
182 any missing files. If an optional second argument which evaluates to true is
183 given any missing files will be removed from the .packlist
184 .IP \fBpacklist()\fR 4
185 .IX Item "packlist()"
186 This returns the ExtUtils::Packlist object for the specified module.
187 .IP \fBversion()\fR 4
188 .IX Item "version()"
189 This returns the version number for the specified module.
190 .SH EXAMPLE
191 .IX Header "EXAMPLE"
192 See the example in ExtUtils::Packlist.
193 .SH AUTHOR
194 .IX Header "AUTHOR"
195 Alan Burlison <[email protected]>