1B::Xref(3pm)           Perl Programmers Reference Guide           B::Xref(3pm)
2
3
4

NAME

6       B::Xref - Generates cross reference reports for Perl programs
7

SYNOPSIS

9       perl -MO=Xref[,OPTIONS] foo.pl
10

DESCRIPTION

12       The B::Xref module is used to generate a cross reference listing of all
13       definitions and uses of variables, subroutines and formats in a Perl
14       program.  It is implemented as a backend for the Perl compiler.
15
16       The report generated is in the following format:
17
18           File filename1
19             Subroutine subname1
20               Package package1
21                 object1        line numbers
22                 object2        line numbers
23                 ...
24               Package package2
25               ...
26
27       Each File section reports on a single file. Each Subroutine section
28       reports on a single subroutine apart from the special cases "(defini‐
29       tions)" and "(main)". These report, respectively, on subroutine defini‐
30       tions found by the initial symbol table walk and on the main part of
31       the program or module external to all subroutines.
32
33       The report is then grouped by the Package of each variable, subroutine
34       or format with the special case "(lexicals)" meaning lexical variables.
35       Each object name (implicitly qualified by its containing Package)
36       includes its type character(s) at the beginning where possible. Lexical
37       variables are easier to track and even included dereferencing informa‐
38       tion where possible.
39
40       The "line numbers" are a comma separated list of line numbers (some
41       preceded by code letters) where that object is used in some way.  Sim‐
42       ple uses aren't preceded by a code letter. Introductions (such as where
43       a lexical is first defined with "my") are indicated with the letter
44       "i". Subroutine and method calls are indicated by the character "&".
45       Subroutine definitions are indicated by "s" and format definitions by
46       "f".
47

OPTIONS

49       Option words are separated by commas (not whitespace) and follow the
50       usual conventions of compiler backend options.
51
52       "-oFILENAME"
53               Directs output to "FILENAME" instead of standard output.
54
55       "-r"    Raw output. Instead of producing a human-readable report, out‐
56               puts a line in machine-readable form for each definition/use of
57               a variable/sub/format.
58
59       "-d"    Don't output the "(definitions)" sections.
60
61       "-D[tO]"
62               (Internal) debug options, probably only useful if "-r"
63               included.  The "t" option prints the object on the top of the
64               stack as it's being tracked. The "O" option prints each opera‐
65               tor as it's being processed in the execution order of the pro‐
66               gram.
67

BUGS

69       Non-lexical variables are quite difficult to track through a program.
70       Sometimes the type of a non-lexical variable's use is impossible to
71       determine. Introductions of non-lexical non-scalars don't seem to be
72       reported properly.
73

AUTHOR

75       Malcolm Beattie, mbeattie@sable.ox.ac.uk.
76
77
78
79perl v5.8.8                       2001-09-21                      B::Xref(3pm)
Impressum