|
Softpanorama |
May the source be with you, but remember the KISS principle ;-)
Softpanorama Search
|
The most useful option the cross referencer has is to save the report
to a separate file. For instance, to save the report on myperlprogram
to the file report:
$ perl -MO=Xref,-oreport
myperlprogram
The cross referencing back end (B::Xref) produces a report on your program, breaking down declarations and uses of subroutines and variables (and formats) by file and subroutine. For instance, here's part of the report from the pod2man program that comes with Perl:
Subroutine clear_noremap
Package (lexical)
$ready_to_print i1069, 1079
Package main
$&
1086
$.
1086
$0
1086
$1
1087
$2
1085, 1085
$3
1085, 1085
$ARGV
1086
%HTML_Escapes 1085, 1085
This shows the variables used in the
subroutine "clear_noremap". The
variable $ready_to_print is a my()
(lexical) variable, introduced
(first declared with my()) on line
1069, and used on line 1079. The
variable $& from the main package is
used on 1086, and so on.
A line number may be prefixed by a
single letter:
i Lexical variable introduced
(declared with my()) for the first
time.
& Subroutine or method
call.
s Subroutine defined.
r Format defined.
|
|||||||
BXref - Generates cross reference reports for Perl programs
Copyright © 1996-2009 by Dr. Nikolai Bezroukov. www.softpanorama.org was created as a service to the UN Sustainable Development Networking Programme (SDNP) in the author free time. Submit comments This document is an industrial compilation designed and created exclusively for educational use and is placed under the copyright of the Open Content License(OPL). Site uses AdSense so you need to be aware of Google privacy policy. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.
Disclaimer:
Last updated: August 15, 2009