1forks::Devel::Symdump(3U)ser Contributed Perl Documentatifoonrks::Devel::Symdump(3)
2
3
4
6 forks::Devel::Symdump - dump symbol names or the symbol table
7
9 # Constructor
10 require forks::Devel::Symdump;
11 @packs = qw(some_package another_package);
12 $obj = forks::Devel::Symdump->new(@packs); # no recursion
13 $obj = forks::Devel::Symdump->rnew(@packs); # with recursion
14
15 # Methods
16 @array = $obj->packages;
17 @array = $obj->scalars;
18 @array = $obj->arrays;
19 @array = $obj->hashes;
20 @array = $obj->functions;
21 @array = $obj->filehandles; # deprecated, use ios instead
22 @array = $obj->dirhandles; # deprecated, use ios instead
23 @array = $obj->ios;
24 @array = $obj->unknowns; # only perl version < 5.003 had some
25
26 $string = $obj->as_string;
27 $string = $obj->as_HTML;
28 $string = $obj1->diff($obj2);
29
30 $string = forks::Devel::Symdump->isa_tree; # or $obj->isa_tree
31 $string = forks::Devel::Symdump->inh_tree; # or $obj->inh_tree
32
33 # Methods with autogenerated objects
34 # all of those call new(@packs) internally
35 @array = forks::Devel::Symdump->packages(@packs);
36 @array = forks::Devel::Symdump->scalars(@packs);
37 @array = forks::Devel::Symdump->arrays(@packs);
38 @array = forks::Devel::Symdump->hashes(@packs);
39 @array = forks::Devel::Symdump->functions(@packs);
40 @array = forks::Devel::Symdump->ios(@packs);
41 @array = forks::Devel::Symdump->unknowns(@packs);
42
44 This little package serves to access the symbol table of perl.
45
46 "forks::Devel::Symdump->rnew(@packages)"
47 returns a symbol table object for all subtrees below @packages.
48 Nested Modules are analyzed recursively. If no package is given as
49 argument, it defaults to "main". That means to get the whole symbol
50 table, just do a "rnew" without arguments.
51
52 The global variable $forks::Devel::Symdump::MAX_RECURSION limits
53 the recursion to prevent contention. The default value is set to
54 97, just low enough to survive the test suite without a warning
55 about deep recursion.
56
57 "forks::Devel::Symdump->new(@packages)"
58 does not go into recursion and only analyzes the packages that are
59 given as arguments.
60
61 packages, scalars, arrays, hashes, functions, ios
62 The methods packages(), scalars(), arrays(), hashes(), functions(),
63 ios(), and (for older perls) unknowns() each return an array of
64 fully qualified symbols of the specified type in all packages that
65 are held within a forks::Devel::Symdump object, but without the
66 leading "$", "@" or "%". In a scalar context, they will return the
67 number of such symbols. Unknown symbols are usually either formats
68 or variables that haven't yet got a defined value.
69
70 as_string
71 as_HTML
72 As_string() and as_HTML() return a simple string/HTML
73 representations of the object.
74
75 diff
76 Diff() prints the difference between two forks::Devel::Symdump
77 objects in human readable form. The format is similar to the one
78 used by the as_string method.
79
80 isa_tree
81 inh_tree
82 Isa_tree() and inh_tree() both return a simple string
83 representation of the current inheritance tree. The difference
84 between the two methods is the direction from which the tree is
85 viewed: top-down or bottom-up. As I'm sure, many users will have
86 different expectation about what is top and what is bottom, I'll
87 provide an example what happens when the Socket module is loaded:
88
89 % print forks::Devel::Symdump->inh_tree
90 AutoLoader
91 DynaLoader
92 Socket
93 DynaLoader
94 Socket
95 Exporter
96 Carp
97 Config
98 Socket
99
100 The inh_tree method shows on the left hand side a package name and
101 indented to the right the packages that use the former.
102
103 % print forks::Devel::Symdump->isa_tree
104 Carp
105 Exporter
106 Config
107 Exporter
108 DynaLoader
109 AutoLoader
110 Socket
111 Exporter
112 DynaLoader
113 AutoLoader
114
115 The isa_tree method displays from left to right ISA relationships,
116 so Socket IS A DynaLoader and DynaLoader IS A AutoLoader.
117 (Actually, they were at the time this manpage was written)
118
119 You may call both methods, isa_tree() and inh_tree(), with an object.
120 If you do that, the object will store the output and retrieve it when
121 you call the same method again later. The typical usage would be to use
122 them as class methods directly though.
123
125 The design of this package is intentionally primitive and allows it to
126 be subclassed easily. An example of a (maybe) useful subclass is
127 forks::Devel::Symdump::Export, a package which exports all methods of
128 the forks::Devel::Symdump package and turns them into functions.
129
131 Andreas Koenig <andk@cpan.org> and Tom Christiansen <tchrist@perl.com>.
132 Based on the old dumpvar.pl by Larry Wall.
133
135 This is a modified version of Devel::Symdump 2.08. It includes custom
136 patches for Perl 5.10 compatibility.
137
138 Original module is
139
140 Copyright (c) 1995, 1997, 2000, 2002, 2005, 2006 Andreas Koenig
141 "<andk@cpan.org>".
142
143 All rights reserved.
144
145 This library is free software; you may use, redistribute and/or modify
146 it under the same terms as Perl itself.
147
148
149
150perl v5.38.0 2023-07-21 forks::Devel::Symdump(3)