.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "forks::Devel::Symdump 3pm" .TH forks::Devel::Symdump 3pm 2024-03-07 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME forks::Devel::Symdump \- dump symbol names or the symbol table .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 5 \& # Constructor \& require forks::Devel::Symdump; \& @packs = qw(some_package another_package); \& $obj = forks::Devel::Symdump\->new(@packs); # no recursion \& $obj = forks::Devel::Symdump\->rnew(@packs); # with recursion \& \& # Methods \& @array = $obj\->packages; \& @array = $obj\->scalars; \& @array = $obj\->arrays; \& @array = $obj\->hashes; \& @array = $obj\->functions; \& @array = $obj\->filehandles; # deprecated, use ios instead \& @array = $obj\->dirhandles; # deprecated, use ios instead \& @array = $obj\->ios; \& @array = $obj\->unknowns; # only perl version < 5.003 had some \& \& $string = $obj\->as_string; \& $string = $obj\->as_HTML; \& $string = $obj1\->diff($obj2); \& \& $string = forks::Devel::Symdump\->isa_tree; # or $obj\->isa_tree \& $string = forks::Devel::Symdump\->inh_tree; # or $obj\->inh_tree \& \& # Methods with autogenerated objects \& # all of those call new(@packs) internally \& @array = forks::Devel::Symdump\->packages(@packs); \& @array = forks::Devel::Symdump\->scalars(@packs); \& @array = forks::Devel::Symdump\->arrays(@packs); \& @array = forks::Devel::Symdump\->hashes(@packs); \& @array = forks::Devel::Symdump\->functions(@packs); \& @array = forks::Devel::Symdump\->ios(@packs); \& @array = forks::Devel::Symdump\->unknowns(@packs); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" This little package serves to access the symbol table of perl. .ie n .IP """forks::Devel::Symdump\->rnew(@packages)""" 4 .el .IP \f(CWforks::Devel::Symdump\->rnew(@packages)\fR 4 .IX Item "forks::Devel::Symdump->rnew(@packages)" returns a symbol table object for all subtrees below \f(CW@packages\fR. Nested Modules are analyzed recursively. If no package is given as argument, it defaults to \f(CW\*(C`main\*(C'\fR. That means to get the whole symbol table, just do a \f(CW\*(C`rnew\*(C'\fR without arguments. .Sp The global variable \f(CW$forks::Devel::Symdump::MAX_RECURSION\fR limits the recursion to prevent contention. The default value is set to 97, just low enough to survive the test suite without a warning about deep recursion. .ie n .IP """forks::Devel::Symdump\->new(@packages)""" 4 .el .IP \f(CWforks::Devel::Symdump\->new(@packages)\fR 4 .IX Item "forks::Devel::Symdump->new(@packages)" does not go into recursion and only analyzes the packages that are given as arguments. .IP "packages, scalars, arrays, hashes, functions, ios" 4 .IX Item "packages, scalars, arrays, hashes, functions, ios" The methods \fBpackages()\fR, \fBscalars()\fR, \fBarrays()\fR, \fBhashes()\fR, \fBfunctions()\fR, \&\fBios()\fR, and (for older perls) \fBunknowns()\fR each return an array of fully qualified symbols of the specified type in all packages that are held within a forks::Devel::Symdump object, but without the leading \f(CW\*(C`$\*(C'\fR, \f(CW\*(C`@\*(C'\fR or \&\f(CW\*(C`%\*(C'\fR. In a scalar context, they will return the number of such symbols. Unknown symbols are usually either formats or variables that haven't yet got a defined value. .IP as_string 4 .IX Item "as_string" .PD 0 .IP as_HTML 4 .IX Item "as_HTML" .PD \&\fBAs_string()\fR and \fBas_HTML()\fR return a simple string/HTML representations of the object. .IP diff 4 .IX Item "diff" \&\fBDiff()\fR prints the difference between two forks::Devel::Symdump objects in human readable form. The format is similar to the one used by the as_string method. .IP isa_tree 4 .IX Item "isa_tree" .PD 0 .IP inh_tree 4 .IX Item "inh_tree" .PD \&\fBIsa_tree()\fR and \fBinh_tree()\fR both return a simple string representation of the current inheritance tree. The difference between the two methods is the direction from which the tree is viewed: top-down or bottom-up. As I'm sure, many users will have different expectation about what is top and what is bottom, I'll provide an example what happens when the Socket module is loaded: .IP "% print forks::Devel::Symdump\->inh_tree" 4 .IX Item "% print forks::Devel::Symdump->inh_tree" .Vb 9 \& AutoLoader \& DynaLoader \& Socket \& DynaLoader \& Socket \& Exporter \& Carp \& Config \& Socket .Ve .Sp The inh_tree method shows on the left hand side a package name and indented to the right the packages that use the former. .IP "% print forks::Devel::Symdump\->isa_tree" 4 .IX Item "% print forks::Devel::Symdump->isa_tree" .Vb 10 \& Carp \& Exporter \& Config \& Exporter \& DynaLoader \& AutoLoader \& Socket \& Exporter \& DynaLoader \& AutoLoader .Ve .Sp The isa_tree method displays from left to right ISA relationships, so Socket IS A DynaLoader and DynaLoader IS A AutoLoader. (Actually, they were at the time this manpage was written) .PP You may call both methods, \fBisa_tree()\fR and \fBinh_tree()\fR, with an object. If you do that, the object will store the output and retrieve it when you call the same method again later. The typical usage would be to use them as class methods directly though. .SH SUBCLASSING .IX Header "SUBCLASSING" The design of this package is intentionally primitive and allows it to be subclassed easily. An example of a (maybe) useful subclass is forks::Devel::Symdump::Export, a package which exports all methods of the forks::Devel::Symdump package and turns them into functions. .SH AUTHORS .IX Header "AUTHORS" Andreas Koenig \fI\fR and Tom Christiansen \&\fI\fR. Based on the old \fIdumpvar.pl\fR by Larry Wall. .SH "COPYRIGHT, LICENSE" .IX Header "COPYRIGHT, LICENSE" This is a modified version of Devel::Symdump 2.08. It includes custom patches for Perl 5.10 compatibility. .PP Original module is .PP Copyright (c) 1995, 1997, 2000, 2002, 2005, 2006 Andreas Koenig \f(CW\*(C`\*(C'\fR. .PP All rights reserved. .PP This library is free software; you may use, redistribute and/or modify it under the same terms as Perl itself.