forks:...Symdump(3pm)
β¨ NAME β¨
forks::Devel::Symdump β dump symbol names or the symbol table π
hiii bestie π«Ά this is the forks:...Symdump(3pm) page from the User Contributed Perl Documentation, and no cap, it's about to make the perl symbol table make sense.
πΈ SYNOPSIS πΈ
# 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);
The comments in there are literally doing the explaining for me, so likeβ¦ read them? π
π¦ DESCRIPTION π¦
This little package serves to access the symbol table of perl. tiny but iconic, fr fr.
forks::Devel::Symdump->rnew(@packages)
returns a symbol table object for all subtrees below @packages. Nested Modules are analyzed recursively. If no package is given as argument, it defaults to "main". That means to get the whole symbol table, just do a rnew without arguments. the whole entire thing, no filters, we're nosy like that π
The global variable $forks::Devel::Symdump::MAX_RECURSION 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. so 97 is the vibe. don't touch it unless you know what you're doing bestie β¨
forks::Devel::Symdump->new(@packages)
does not go into recursion and only analyzes the packages that are given as arguments. very demure, very mindful, stays in its lane π
packages, scalars, arrays, hashes, functions, ios
The methods packages(), scalars(), arrays(), hashes(), functions(), ios(), and (for older perls) unknowns() 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 "$", "@" or "%". 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.
tl;dr β ask for scalars, get scalars. ask in scalar context, get a count. the math is mathing π₯
as_string
as_HTML
as_string() and as_HTML() return a simple string/HTML representations of the object. simple. clean. aesthetic. β¨
diff
diff() 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. it's giving "spot the difference" but for symbol tables π
isa_tree
inh_tree
isa_tree() and inh_tree() 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:
% print forks::Devel::Symdump->inh_tree
AutoLoader
DynaLoader
Socket
DynaLoader
Socket
Exporter
Carp
Config
Socket
The inh_tree method shows on the left hand side a package name and indented to the right the packages that use the former.
% print forks::Devel::Symdump->isa_tree
Carp
Exporter
Config
Exporter
DynaLoader
AutoLoader
Socket
Exporter
DynaLoader
AutoLoader
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) π
You may call both methods, isa_tree() and inh_tree(), 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.
so like β call it on an object and it caches the result for you, call it on the class and it just does the thing. both slay, pick your fighter π§
π 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.
intentionally primitive is such a flex honestly. main character energy π
π AUTHORS π
Andreas Koenig andk@cpan.org and Tom Christiansen tchrist@perl.com. Based on the old dumpvar.pl by Larry Wall.
π COPYRIGHT, LICENSE π
This is a modified version of Devel::Symdump 2.08. It includes custom patches for Perl 5.10 compatibility.
Original module is
Copyright (c) 1995, 1997, 2000, 2002, 2005, 2006 Andreas Koenig
"<andk@cpan.org>".
All rights reserved.
This library is free software; you may use, redistribute and/or modify it under the same terms as Perl itself.
and that's the whole page bestie π this was forks:...Symdump(3pm) from perl v5.42.3, dated 2026-08-20. go forth and dump those symbols, periodt π¦β¨
π¦ where this page comes from
- ubuntu stonking: libforks-perl 0.36-3build6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms