Sepia::Xref(3pm)
π NAME π
Sepia::Xref β bestie, it literally generates a cross reference database for use by Perl programs. That's it, that's the job. π
β¨ SYNOPSIS β¨
use Sepia::Xref qw(rebuild defs callers);
rebuild;
for (defs 'foo') {
printf "%s:%d: sub %s\::foo() defined\n", @{$_}[0..2];
}
for (callers 'foo') {
printf "%s:%d: sub foo() called by %s\::%s().\n", @{$_}[0..3];
}
like, look at that. it just works. π
π¦ DESCRIPTION π¦
Sepia::Xref is intended as a programmatic interface to the information supplied by B::Xref. it's meant to be a component for interactive Perl development, with other packages providing a friendly interface to the raw information it extracts. B::Xref could be seen as an example of this sort of user-level tool β if it weren't for the fact that this module was created later, and stole most of its code. π iconic behaviour honestly. no cap.
πΈ Variables
%callβ a map of subs to call locations and callers. slay.%callbyβ a map of subs to subs called.%var_useβ a map of global/package variables to uses.%var_defβ a map of global/package variables to definitions (usually empty, since it only picks uplocal (...)declarations). it's giving "usually nothing here", bestie. π
π Functions
guess_module_file($pack, $ofile)βXXX: it turns out that rooting around trying to figure out the file ourselves is more reliable than what we grab from the op. are we doing this wrong? (the author said it, not me. π«Ά)rebuild()β rebuild the Xref database. periodt.forget($func [, $mod])β forget that$funcwas defined. bye bestie. πredefined($func [, $pack])β recompute xref info for$func, or"$pack::$func"if$packgiven.callers($func)β list callers of$func. who's calling you bestie? πcallees($func)β list callees of$func.var_defs($var)β find locations where$varis defined.var_uses($var)β find locations where$varis used.var_assigns($var)β find locations where$varis assigned to.file_modules($file)β list the modules defined in file$file.var_apropos($expr)β find variables matching$expr.
π EXPORTS π
nothing by default, bestie β but all the subs and variables described above can be imported. Sepia::Xref also defines the tags :most for the above-listed functions, and :all for those and the variables as well. so like, choose your fighter. β¨
π BUGS π
- see
B::Xref. - module names are ignored when looking up a sub. lowkey wild.
- file and line number guessing is evil β both should be done more cleanly and effectively. this is a hack because the author doesn't quite understand what perl saves. we should be able to do as well as its warning messages. π fr fr.
- Some packages are not xref'd. β some "internal" packages are deliberately not cross-referenced, either because they are hairy and cause us problems, or because they are so commonly included as to be uninteresting. the current list includes all pragmatic modules, plus:
B,O,AutoLoader,DynaLoader,XSLoader,Config,DB,VMS,FileHandle,Exporter,Carp,PerlIO::Layer. - Tree-view is not fully functional β ideally, clicking the function names in tree view would take you to that function. this doesn't work. also, more keys (like
"q"to quit) should be implemented. bestie theqkey is literally the bare minimum and it's not there. π
not me listing bugs with love and affection. the vibes are honest, okay? π«Ά
π SEE ALSO π
B::Xref, of which Sepia::Xref is a bastard child. family is family. π
π AUTHOR π
B::Xref by Malcolm Beattie, m(angl|odifi)ed by Sean O'Rourke (seano@cpan.org). legends only. β¨
and that's the whole page, bestie β this one's from perl v5.34.0, dated 2022-06-26, Sepia::Xref(3pm). go read some cross references, you main character. ππ¦π
π¦ where this page comes from
- debian bookworm: sepia 0.992-8 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: sepia 0.992-8 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: sepia 0.992-8 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu questing: sepia 0.992-8
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms