📄 xref.html
字号:
<?xml version="1.0" ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<!-- saved from url=(0017)http://localhost/ -->
<script language="JavaScript" src="../../displayToc.js"></script>
<script language="JavaScript" src="../../tocParas.js"></script>
<script language="JavaScript" src="../../tocTab.js"></script>
<link rel="stylesheet" type="text/css" href="../../scineplex.css">
<title>B::Xref - Generates cross reference reports for Perl programs</title>
<link rel="stylesheet" href="../../Active.css" type="text/css" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:" />
</head>
<body>
<script>writelinks('__top__',2);</script>
<h1><a>B::Xref - Generates cross reference reports for Perl programs</a></h1>
<p><a name="__index__"></a></p>
<!-- INDEX BEGIN -->
<ul>
<li><a href="#name">NAME</a></li>
<li><a href="#synopsis">SYNOPSIS</a></li>
<li><a href="#description">DESCRIPTION</a></li>
<li><a href="#options">OPTIONS</a></li>
<li><a href="#bugs">BUGS</a></li>
<li><a href="#author">AUTHOR</a></li>
</ul>
<!-- INDEX END -->
<hr />
<p>
</p>
<h1><a name="name">NAME</a></h1>
<p>B::Xref - Generates cross reference reports for Perl programs</p>
<p>
</p>
<hr />
<h1><a name="synopsis">SYNOPSIS</a></h1>
<p>perl -MO=Xref[,OPTIONS] foo.pl</p>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<p>The B::Xref module is used to generate a cross reference listing of all
definitions and uses of variables, subroutines and formats in a Perl program.
It is implemented as a backend for the Perl compiler.</p>
<p>The report generated is in the following format:</p>
<pre>
File filename1
Subroutine subname1
Package package1
object1 line numbers
object2 line numbers
...
Package package2
...</pre>
<p>Each <strong>File</strong> section reports on a single file. Each <strong>Subroutine</strong> section
reports on a single subroutine apart from the special cases
"(definitions)" and "(main)". These report, respectively, on subroutine
definitions found by the initial symbol table walk and on the main part of
the program or module external to all subroutines.</p>
<p>The report is then grouped by the <strong>Package</strong> of each variable,
subroutine or format with the special case "(lexicals)" meaning
lexical variables. Each <strong>object</strong> name (implicitly qualified by its
containing <strong>Package</strong>) includes its type <code>character(s)</code> at the beginning
where possible. Lexical variables are easier to track and even
included dereferencing information where possible.</p>
<p>The <code>line numbers</code> are a comma separated list of line numbers (some
preceded by code letters) where that object is used in some way.
Simple uses aren't preceded by a code letter. Introductions (such as
where a lexical is first defined with <a href="../../lib/Pod/perlfunc.html#item_my"><code>my</code></a>) are indicated with the
letter "i". Subroutine and method calls are indicated by the character
"&". Subroutine definitions are indicated by "s" and format
definitions by "f".</p>
<p>
</p>
<hr />
<h1><a name="options">OPTIONS</a></h1>
<p>Option words are separated by commas (not whitespace) and follow the
usual conventions of compiler backend options.</p>
<dl>
<dt><strong><a name="item__2dofilename"><code>-oFILENAME</code></a></strong>
<dd>
<p>Directs output to <code>FILENAME</code> instead of standard output.</p>
</dd>
</li>
<dt><strong><a name="item__2dr"><code>-r</code></a></strong>
<dd>
<p>Raw output. Instead of producing a human-readable report, outputs a line
in machine-readable form for each definition/use of a variable/sub/format.</p>
</dd>
</li>
<dt><strong><a name="item__2dd"><code>-d</code></a></strong>
<dd>
<p>Don't output the "(definitions)" sections.</p>
</dd>
</li>
<dt><strong><a name="item__2dd_5bto_5d"><code>-D[tO]</code></a></strong>
<dd>
<p>(Internal) debug options, probably only useful if <a href="#item__2dr"><code>-r</code></a> included.
The <code>t</code> option prints the object on the top of the stack as it's
being tracked. The <code>O</code> option prints each operator as it's being
processed in the execution order of the program.</p>
</dd>
</li>
</dl>
<p>
</p>
<hr />
<h1><a name="bugs">BUGS</a></h1>
<p>Non-lexical variables are quite difficult to track through a program.
Sometimes the type of a non-lexical variable's use is impossible to
determine. Introductions of non-lexical non-scalars don't seem to be
reported properly.</p>
<p>
</p>
<hr />
<h1><a name="author">AUTHOR</a></h1>
<p>Malcolm Beattie, <a href="mailto:mbeattie@sable.ox.ac.uk.">mbeattie@sable.ox.ac.uk.</a></p>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -