NAME
Devel::Symdump - dump symbol names or the symbol table
SYNOPSIS
# Constructor
require Devel::Symdump;
@packs = qw(some_package another_package);
$obj = Devel::Symdump->new(@packs); # no recursion
$obj = Devel::Symdump->rnew(@packs); # with recursion
# Methods
@array = $obj->packages;
@array = $obj->scalars;
@array = $obj->arrays;
@array = $obj->hashs;
@array = $obj->functions;
@array = $obj->filehandles;
@array = $obj->dirhandles;
@array = $obj->unknowns;
$string = $obj->as_string;
$string = $obj1->diff($obj2);
# Methods with autogenerated objects
# all of those call new(@packs) internally
@array = Devel::Symdump->packages(@packs);
@array = Devel::Symdump->scalars(@packs);
@array = Devel::Symdump->arrays(@packs);
@array = Devel::Symdump->hashes(@packs);
@array = Devel::Symdump->functions(@packs);
@array = Devel::Symdump->filehandles(@packs);
@array = Devel::Symdump->dirhandles(@packs);
@array = Devel::Symdump->unknowns(@packs);
DESCRIPTION
This little package serves to access the symbol table of perl.
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.
Devel::Symdump->new(@packages)
does not go into recursion and only analyzes the packages that are given as arguments.
The methods packages(), scalars(), arrays(), hashes(), functions(), filehandles(), dirhandles(), and unknowns() each return an array of fully qualified symbols of the specified type in all packages that are held within a 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.
As_string() prints a simple string representation of the object.
Diff() prints the difference between two Devel::Symdump objects in human readable form. The format is similar to the one used by the as_string method.
SUBCLASSING
The design of this package is intentionally primitiv and allows it to be subclassed easily. An example of a useful subclass is Devel::Symdump::Export, a package which exports all methods of the Devel::Symdump package and turns them into functions.
AUTHORS
Andreas Koenig <koenig@franz.ww.TU-Berlin.DE> and Tom Christiansen <tchrist@perl.com>. Based on the old dumpvar.pl by Larry Wall.
VERSION
This release is $Revision: 1.23 $.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 244:
You forgot a '=back' before '=head2'