Debian Codegraph @

upstream/opensuse-tumbleweed/man3/B::Showlex.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 "B::Showlex 3pm"
61 .TH B::Showlex 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 B::Showlex \- Show lexical variables used in functions or files
68 .SH SYNOPSIS
69 .IX Header "SYNOPSIS"
70 .Vb 1
71 \& perl \-MO=Showlex[,\-OPTIONS][,SUBROUTINE] foo.pl
72 .Ve
73 .SH DESCRIPTION
74 .IX Header "DESCRIPTION"
75 When a comma\-separated list of subroutine names is given as options, Showlex
76 prints the lexical variables used in those subroutines. Otherwise, it prints
77 the file\-scope lexicals in the file.
78 .SH EXAMPLES
79 .IX Header "EXAMPLES"
80 Traditional form:
81 .PP
82 .Vb 10
83 \& $ perl \-MO=Showlex \-e \*(Aqmy ($i,$j,$k)=(1,"foo")\*(Aq
84 \& Pad of lexical names for comppadlist has 4 entries
85 \& 0: (0x8caea4) undef
86 \& 1: (0x9db0fb0) $i
87 \& 2: (0x9db0f38) $j
88 \& 3: (0x9db0f50) $k
89 \& Pad of lexical values for comppadlist has 5 entries
90 \& 0: SPECIAL #1 &PL_sv_undef
91 \& 1: NULL (0x9da4234)
92 \& 2: NULL (0x9db0f2c)
93 \& 3: NULL (0x9db0f44)
94 \& 4: NULL (0x9da4264)
95 \& \-e syntax OK
96 .Ve
97 .PP
98 New\-style form:
99 .PP
100 .Vb 7
101 \& $ perl \-MO=Showlex,\-newlex \-e \*(Aqmy ($i,$j,$k)=(1,"foo")\*(Aq
102 \& main Pad has 4 entries
103 \& 0: (0x8caea4) undef
104 \& 1: (0xa0c4fb8) "$i" = NULL (0xa0b8234)
105 \& 2: (0xa0c4f40) "$j" = NULL (0xa0c4f34)
106 \& 3: (0xa0c4f58) "$k" = NULL (0xa0c4f4c)
107 \& \-e syntax OK
108 .Ve
109 .PP
110 New form, no specials, outside O framework:
111 .PP
112 .Vb 6
113 \& $ perl \-MB::Showlex \-e \e
114 \& \*(Aqmy ($i,$j,$k)=(1,"foo"); B::Showlex::compile(\-newlex,\-nosp)\->()\*(Aq
115 \& main Pad has 4 entries
116 \& 1: (0x998ffb0) "$i" = IV (0x9983234) 1
117 \& 2: (0x998ff68) "$j" = PV (0x998ff5c) "foo"
118 \& 3: (0x998ff80) "$k" = NULL (0x998ff74)
119 .Ve
120 .PP
121 Note that this example shows the values of the lexicals, whereas the other
122 examples did not (as they\*(Aqre compile\-time only).
123 .SS OPTIONS
124 .IX Subsection "OPTIONS"
125 The \f(CW\*(C`\-newlex\*(C'\fR option produces a more readable \f(CW\*(C`name => value\*(C'\fR format,
126 and is shown in the second example above.
127 .PP
128 The \f(CW\*(C`\-nosp\*(C'\fR option eliminates reporting of SPECIALs, such as \f(CW\*(C`0: SPECIAL
129 #1 &PL_sv_undef\*(C'\fR above. Reporting of SPECIALs can sometimes overwhelm
130 your declared lexicals.
131 .SH "SEE ALSO"
132 .IX Header "SEE ALSO"
133 B::Showlex can also be used outside of the O framework, as in the third
134 example. See B::Concise for a fuller explanation of reasons.
135 .SH TODO
136 .IX Header "TODO"
137 Some of the reported info, such as hex addresses, is not particularly
138 valuable. Other information would be more useful for the typical
139 programmer, such as line\-numbers, pad\-slot reuses, etc.. Given this,
140 \&\-newlex is not a particularly good flag\-name.
141 .SH AUTHOR
142 .IX Header "AUTHOR"
143 Malcolm Beattie, \f(CW\*(C`[email protected]\*(C'\fR