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">
5 <title>B::Xref - Generates cross reference reports for Perl programs
</title>
6 <meta http-equiv=
"content-type" content=
"text/html; charset=utf-8" />
7 <link rev=
"made" href=
"mailto:" />
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"> B::Xref - Generates cross reference reports for Perl programs
</span></strong></big>
17 <p><a name=
"__index__"></a></p>
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=
"#options">OPTIONS
</a></li>
26 <li><a href=
"#bugs">BUGS
</a></li>
27 <li><a href=
"#author">AUTHOR
</a></li>
34 <h1><a name=
"name">NAME
</a></h1>
35 <p>B::Xref - Generates cross reference reports for Perl programs
</p>
39 <h1><a name=
"synopsis">SYNOPSIS
</a></h1>
40 <p>perl -MO=Xref[,OPTIONS] foo.pl
</p>
44 <h1><a name=
"description">DESCRIPTION
</a></h1>
45 <p>The B::Xref module is used to generate a cross reference listing of all
46 definitions and uses of variables, subroutines and formats in a Perl program.
47 It is implemented as a backend for the Perl compiler.
</p>
48 <p>The report generated is in the following format:
</p>
58 <p>Each
<strong>File
</strong> section reports on a single file. Each
<strong>Subroutine
</strong> section
59 reports on a single subroutine apart from the special cases
60 ``(definitions)'' and ``(main)''. These report, respectively, on subroutine
61 definitions found by the initial symbol table walk and on the main part of
62 the program or module external to all subroutines.
</p>
63 <p>The report is then grouped by the
<strong>Package
</strong> of each variable,
64 subroutine or format with the special case ``(lexicals)'' meaning
65 lexical variables. Each
<strong>object
</strong> name (implicitly qualified by its
66 containing
<strong>Package
</strong>) includes its type
<code>character(s)
</code> at the beginning
67 where possible. Lexical variables are easier to track and even
68 included dereferencing information where possible.
</p>
69 <p>The
<code>line numbers
</code> are a comma separated list of line numbers (some
70 preceded by code letters) where that object is used in some way.
71 Simple uses aren't preceded by a code letter. Introductions (such as
72 where a lexical is first defined with
<a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_my"><code>my
</code></a>) are indicated with the
73 letter ``i''. Subroutine and method calls are indicated by the character
74 ``
&''. Subroutine definitions are indicated by ``s'' and format
75 definitions by ``f''.
</p>
79 <h1><a name=
"options">OPTIONS
</a></h1>
80 <p>Option words are separated by commas (not whitespace) and follow the
81 usual conventions of compiler backend options.
</p>
83 <dt><strong><a name=
"item__2dofilename"><code>-oFILENAME
</code></a></strong>
86 <p>Directs output to
<code>FILENAME
</code> instead of standard output.
</p>
89 <dt><strong><a name=
"item__2dr"><code>-r
</code></a></strong>
92 <p>Raw output. Instead of producing a human-readable report, outputs a line
93 in machine-readable form for each definition/use of a variable/sub/format.
</p>
96 <dt><strong><a name=
"item__2dd"><code>-d
</code></a></strong>
99 <p>Don't output the ``(definitions)'' sections.
</p>
102 <dt><strong><a name=
"item__2dd_5bto_5d"><code>-D[tO]
</code></a></strong>
105 <p>(Internal) debug options, probably only useful if
<a href=
"#item__2dr"><code>-r
</code></a> included.
106 The
<code>t
</code> option prints the object on the top of the stack as it's
107 being tracked. The
<code>O
</code> option prints each operator as it's being
108 processed in the execution order of the program.
</p>
115 <h1><a name=
"bugs">BUGS
</a></h1>
116 <p>Non-lexical variables are quite difficult to track through a program.
117 Sometimes the type of a non-lexical variable's use is impossible to
118 determine. Introductions of non-lexical non-scalars don't seem to be
119 reported properly.
</p>
123 <h1><a name=
"author">AUTHOR
</a></h1>
124 <p>Malcolm Beattie,
<a href=
"mailto:mbeattie@sable.ox.ac.uk.">mbeattie@sable.ox.ac.uk.
</a></p>
125 <table border=
"0" width=
"100%" cellspacing=
"0" cellpadding=
"3">
126 <tr><td class=
"block" style=
"background-color: #cccccc" valign=
"middle">
127 <big><strong><span class=
"block"> B::Xref - Generates cross reference reports for Perl programs
</span></strong></big>