ext::B::B::Xref(3Perl Programmers Reference Guext::B::B::Xref(3p)
B::Xref - Generates cross reference reports for Perl pro-
grams
perl -MO=Xref[,OPTIONS] foo.pl
The B::Xref module is used to generate a cross reference
listing of all definitions and uses of variables, subrou-
tines and formats in a Perl program. It is implemented as a
backend for the Perl compiler.
The report generated is in the following format:
File filename1
Subroutine subname1
Package package1
object1 line numbers
object2 line numbers
...
Package package2
...
Each File section reports on a single file. Each Subroutine
section reports on a single subroutine apart from the spe-
cial 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.
The report is then grouped by the Package of each variable,
subroutine or format with the special case "(lexicals)"
meaning lexical variables. Each object name (implicitly
qualified by its containing Package) includes its type
character(s) at the beginning where possible. Lexical vari-
ables are easier to track and even included dereferencing
information where possible.
The "line numbers" 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 "my") are indicated with the letter "i". Sub-
routine and method calls are indicated by the character "&".
Subroutine definitions are indicated by "s" and format
definitions by "f".
Option words are separated by commas (not whitespace) and
follow the usual conventions of compiler backend options.
perl v5.8.8 2005-02-05 1
ext::B::B::Xref(3Perl Programmers Reference Guext::B::B::Xref(3p)
"-oFILENAME"
Directs output to "FILENAME" instead of standard
output.
"-r" 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.
"-d" Don't output the "(definitions)" sections.
"-D[tO]"
(Internal) debug options, probably only useful if
"-r" included. The "t" option prints the object on
the top of the stack as it's being tracked. The "O"
option prints each operator as it's being processed
in the execution order of the program.
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.
Malcolm Beattie, mbeattie@sable.ox.ac.uk.
perl v5.8.8 2005-02-05 2
Generated on 2013-04-27 00:20:00 by $MirOS: src/scripts/roff2htm,v 1.77 2013/01/01 20:49:09 tg Exp $
These manual pages and other documentation are copyrighted by their respective writers;
their source is available at our CVSweb,
AnonCVS, and other mirrors. The rest is Copyright © 2002‒2013 The MirOS Project, Germany.
This product includes material
provided by Thorsten Glaser.
This manual page’s HTML representation is supposed to be valid XHTML/1.1; if not, please send a bug report – diffs preferred.