Debian Codegraph @

upstream/debian-unstable/man3/Config::Perl::V.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 "Config::Perl::V 3perl"
58 .TH Config::Perl::V 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 Config::Perl::V \- Structured data retrieval of perl \-V output
65 .SH SYNOPSIS
66 .IX Header "SYNOPSIS"
67 .Vb 1
68 \& use Config::Perl::V;
69 \&
70 \& my $local_config = Config::Perl::V::myconfig ();
71 \& print $local_config\->{config}{osname};
72 .Ve
73 .SH DESCRIPTION
74 .IX Header "DESCRIPTION"
75 .ie n .SS "$conf = myconfig ()"
76 .el .SS "\f(CW$conf\fP = myconfig ()"
77 .IX Subsection "$conf = myconfig ()"
78 This function will collect the data described in "The hash structure" below,
79 and return that as a hash reference. It optionally accepts an option to
80 include more entries from \f(CW%ENV\fR. See "environment" below.
81 .PP
82 Note that this will not work on uninstalled perls when called with
83 \&\f(CW\*(C`\-I/path/to/uninstalled/perl/lib\*(C'\fR, but it works when that path is in
84 \&\f(CW$PERL5LIB\fR or in \f(CW$PERL5OPT\fR, as paths passed using \f(CW\*(C`\-I\*(C'\fR are not
85 known when the \f(CW\*(C`\-V\*(C'\fR information is collected.
86 .ie n .SS "$conf = plv2hash ($text [, ...])"
87 .el .SS "\f(CW$conf\fP = plv2hash ($text [, ...])"
88 .IX Subsection "$conf = plv2hash ($text [, ...])"
89 Convert a sole 'perl \-V' text block, or list of lines, to a complete
90 myconfig hash. All unknown entries are defaulted.
91 .ie n .SS "$info = summary ([$conf])"
92 .el .SS "\f(CW$info\fP = summary ([$conf])"
93 .IX Subsection "$info = summary ([$conf])"
94 Return an arbitrary selection of the information. If no \f(CW$conf\fR is
95 given, \f(CW\*(C`myconfig ()\*(C'\fR is used instead.
96 .ie n .SS "$md5 = signature ([$conf])"
97 .el .SS "\f(CW$md5\fP = signature ([$conf])"
98 .IX Subsection "$md5 = signature ([$conf])"
99 Return the MD5 of the info returned by \f(CW\*(C`summary ()\*(C'\fR without the
100 \&\f(CW\*(C`config_args\*(C'\fR entry.
101 .PP
102 If \f(CW\*(C`Digest::MD5\*(C'\fR is not available, it return a string with only \f(CW0\fR's.
103 .SS "The hash structure"
104 .IX Subsection "The hash structure"
105 The returned hash consists of 4 parts:
106 .IP build 4
107 .IX Item "build"
108 This information is extracted from the second block that is emitted by
109 \&\f(CW\*(C`perl \-V\*(C'\fR, and usually looks something like
110 .Sp
111 .Vb 10
112 \& Characteristics of this binary (from libperl):
113 \& Compile\-time options: DEBUGGING USE_64_BIT_INT USE_LARGE_FILES
114 \& Locally applied patches:
115 \& defined\-or
116 \& MAINT24637
117 \& Built under linux
118 \& Compiled at Jun 13 2005 10:44:20
119 \& @INC:
120 \& /usr/lib/perl5/5.8.7/i686\-linux\-64int
121 \& /usr/lib/perl5/5.8.7
122 \& /usr/lib/perl5/site_perl/5.8.7/i686\-linux\-64int
123 \& /usr/lib/perl5/site_perl/5.8.7
124 \& /usr/lib/perl5/site_perl
125 \& .
126 .Ve
127 .Sp
128 or
129 .Sp
130 .Vb 9
131 \& Characteristics of this binary (from libperl):
132 \& Compile\-time options: DEBUGGING MULTIPLICITY
133 \& PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT
134 \& PERL_MALLOC_WRAP PERL_TRACK_MEMPOOL
135 \& PERL_USE_SAFE_PUTENV USE_ITHREADS
136 \& USE_LARGE_FILES USE_PERLIO
137 \& USE_REENTRANT_API
138 \& Built under linux
139 \& Compiled at Jan 28 2009 15:26:59
140 .Ve
141 .Sp
142 This information is not available anywhere else, including \f(CW%Config\fR,
143 but it is the information that is only known to the perl binary.
144 .Sp
145 The extracted information is stored in 5 entries in the \f(CW\*(C`build\*(C'\fR hash:
146 .RS 4
147 .IP osname 4
148 .IX Item "osname"
149 This is most likely the same as \f(CW$Config{osname}\fR, and was the name
150 known when perl was built. It might be different if perl was cross-compiled.
151 .Sp
152 The default for this field, if it cannot be extracted, is to copy
153 \&\f(CW$Config{osname}\fR. The two may be differing in casing (OpenBSD vs openbsd).
154 .IP stamp 4
155 .IX Item "stamp"
156 This is the time string for which the perl binary was compiled. The default
157 value is 0.
158 .IP options 4
159 .IX Item "options"
160 This is a hash with all the known defines as keys. The value is either 0,
161 which means unknown or unset, or 1, which means defined.
162 .IP derived 4
163 .IX Item "derived"
164 As some variables are reported by a different name in the output of \f(CW\*(C`perl \-V\*(C'\fR
165 than their actual name in \f(CW%Config\fR, I decided to leave the \f(CW\*(C`config\*(C'\fR entry
166 as close to reality as possible, and put in the entries that might have been
167 guessed by the printed output in a separate block.
168 .IP patches 4
169 .IX Item "patches"
170 This is a list of optionally locally applied patches. Default is an empty list.
171 .RE
172 .RS 4
173 .RE
174 .IP environment 4
175 .IX Item "environment"
176 By default this hash is only filled with the environment variables
177 out of \f(CW%ENV\fR that start with \f(CW\*(C`PERL\*(C'\fR, but you can pass the \f(CW\*(C`env\*(C'\fR option
178 to myconfig to get more
179 .Sp
180 .Vb 2
181 \& my $conf = Config::Perl::V::myconfig ({ env => qr/^ORACLE/ });
182 \& my $conf = Config::Perl::V::myconfig ([ env => qr/^ORACLE/ ]);
183 .Ve
184 .IP config 4
185 .IX Item "config"
186 This hash is filled with the variables that \f(CW\*(C`perl \-V\*(C'\fR fills its report
187 with, and it has the same variables that \f(CW\*(C`Config::myconfig\*(C'\fR returns
188 from \f(CW%Config\fR.
189 .IP inc 4
190 .IX Item "inc"
191 This is the list of default \f(CW@INC\fR.
192 .SH REASONING
193 .IX Header "REASONING"
194 This module was written to be able to return the configuration for the
195 currently used perl as deeply as needed for the CPANTESTERS framework.
196 Up until now they used the output of myconfig as a single text blob,
197 and so it was missing the vital binary characteristics of the running
198 perl and the optional applied patches.
199 .SH BUGS
200 .IX Header "BUGS"
201 Please feedback what is wrong
202 .SH TODO
203 .IX Header "TODO"
204 .Vb 4
205 \& * Implement retrieval functions/methods
206 \& * Documentation
207 \& * Error checking
208 \& * Tests
209 .Ve
210 .SH AUTHOR
211 .IX Header "AUTHOR"
212 H.Merijn Brand <[email protected]>
213 .SH "COPYRIGHT AND LICENSE"
214 .IX Header "COPYRIGHT AND LICENSE"
215 Copyright (C) 2009\-2023 H.Merijn Brand
216 .PP
217 This library is free software; you can redistribute it and/or modify
218 it under the same terms as Perl itself.