Install Perl 5.8.8
[msysgit.git] / mingw / html / lib / B / Showlex.html
blobd78be5b131d2ed6cc455f015c68eb8069988ab38
1 <?xml version="1.0" ?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5 <title>B::Showlex - Show lexical variables used in functions or files</title>
6 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7 <link rev="made" href="mailto:" />
8 </head>
10 <body style="background-color: white">
11 <table border="0" width="100%" cellspacing="0" cellpadding="3">
12 <tr><td class="block" style="background-color: #cccccc" valign="middle">
13 <big><strong><span class="block">&nbsp;B::Showlex - Show lexical variables used in functions or files</span></strong></big>
14 </td></tr>
15 </table>
17 <p><a name="__index__"></a></p>
18 <!-- INDEX BEGIN -->
20 <ul>
22 <li><a href="#name">NAME</a></li>
23 <li><a href="#synopsis">SYNOPSIS</a></li>
24 <li><a href="#description">DESCRIPTION</a></li>
25 <li><a href="#examples">EXAMPLES</a></li>
26 <ul>
28 <li><a href="#options">OPTIONS</a></li>
29 </ul>
31 <li><a href="#see_also">SEE ALSO</a></li>
32 <li><a href="#todo">TODO</a></li>
33 <li><a href="#author">AUTHOR</a></li>
34 </ul>
35 <!-- INDEX END -->
37 <hr />
38 <p>
39 </p>
40 <h1><a name="name">NAME</a></h1>
41 <p>B::Showlex - Show lexical variables used in functions or files</p>
42 <p>
43 </p>
44 <hr />
45 <h1><a name="synopsis">SYNOPSIS</a></h1>
46 <pre>
47 perl -MO=Showlex[,-OPTIONS][,SUBROUTINE] foo.pl</pre>
48 <p>
49 </p>
50 <hr />
51 <h1><a name="description">DESCRIPTION</a></h1>
52 <p>When a comma-separated list of subroutine names is given as options, Showlex
53 prints the lexical variables used in those subroutines. Otherwise, it prints
54 the file-scope lexicals in the file.</p>
55 <p>
56 </p>
57 <hr />
58 <h1><a name="examples">EXAMPLES</a></h1>
59 <p>Traditional form:</p>
60 <pre>
61 $ perl -MO=Showlex -e 'my ($i,$j,$k)=(1,&quot;foo&quot;)'
62 Pad of lexical names for comppadlist has 4 entries
63 0: SPECIAL #1 &amp;PL_sv_undef
64 1: PVNV (0x9db0fb0) $i
65 2: PVNV (0x9db0f38) $j
66 3: PVNV (0x9db0f50) $k
67 Pad of lexical values for comppadlist has 5 entries
68 0: SPECIAL #1 &amp;PL_sv_undef
69 1: NULL (0x9da4234)
70 2: NULL (0x9db0f2c)
71 3: NULL (0x9db0f44)
72 4: NULL (0x9da4264)
73 -e syntax OK</pre>
74 <p>New-style form:</p>
75 <pre>
76 $ perl -MO=Showlex,-newlex -e 'my ($i,$j,$k)=(1,&quot;foo&quot;)'
77 main Pad has 4 entries
78 0: SPECIAL #1 &amp;PL_sv_undef
79 1: PVNV (0xa0c4fb8) &quot;$i&quot; = NULL (0xa0b8234)
80 2: PVNV (0xa0c4f40) &quot;$j&quot; = NULL (0xa0c4f34)
81 3: PVNV (0xa0c4f58) &quot;$k&quot; = NULL (0xa0c4f4c)
82 -e syntax OK</pre>
83 <p>New form, no specials, outside O framework:</p>
84 <pre>
85 $ perl -MB::Showlex -e \
86 'my ($i,$j,$k)=(1,&quot;foo&quot;); B::Showlex::compile(-newlex,-nosp)-&gt;()'
87 main Pad has 4 entries
88 1: PVNV (0x998ffb0) &quot;$i&quot; = IV (0x9983234) 1
89 2: PVNV (0x998ff68) &quot;$j&quot; = PV (0x998ff5c) &quot;foo&quot;
90 3: PVNV (0x998ff80) &quot;$k&quot; = NULL (0x998ff74)</pre>
91 <p>Note that this example shows the values of the lexicals, whereas the other
92 examples did not (as they're compile-time only).</p>
93 <p>
94 </p>
95 <h2><a name="options">OPTIONS</a></h2>
96 <p>The <code>-newlex</code> option produces a more readable <code>name =&gt; value</code> format,
97 and is shown in the second example above.</p>
98 <p>The <code>-nosp</code> option eliminates reporting of SPECIALs, such as <code>0: SPECIAL
99 #1 &amp;PL_sv_undef</code> above. Reporting of SPECIALs can sometimes overwhelm
100 your declared lexicals.</p>
102 </p>
103 <hr />
104 <h1><a name="see_also">SEE ALSO</a></h1>
105 <p><code>B::Showlex</code> can also be used outside of the O framework, as in the third
106 example. See <code>B::Concise</code> for a fuller explanation of reasons.</p>
108 </p>
109 <hr />
110 <h1><a name="todo">TODO</a></h1>
111 <p>Some of the reported info, such as hex addresses, is not particularly
112 valuable. Other information would be more useful for the typical
113 programmer, such as line-numbers, pad-slot reuses, etc.. Given this,
114 -newlex isnt a particularly good flag-name.</p>
116 </p>
117 <hr />
118 <h1><a name="author">AUTHOR</a></h1>
119 <p>Malcolm Beattie, <code>mbeattie@sable.ox.ac.uk</code></p>
120 <table border="0" width="100%" cellspacing="0" cellpadding="3">
121 <tr><td class="block" style="background-color: #cccccc" valign="middle">
122 <big><strong><span class="block">&nbsp;B::Showlex - Show lexical variables used in functions or files</span></strong></big>
123 </td></tr>
124 </table>
126 </body>
128 </html>