home *** CD-ROM | disk | FTP | other *** search
-
- <HTML>
- <HEAD>
- <TITLE>Devel::Symdump - dump symbol names or the symbol table</TITLE>
- <LINK REL="stylesheet" HREF="../../../Active.css" TYPE="text/css">
- <LINK REV="made" HREF="mailto:">
- </HEAD>
-
- <BODY>
- <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
- <TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
- <STRONG><P CLASS=block> Devel::Symdump - dump symbol names or the symbol table</P></STRONG>
- </TD></TR>
- </TABLE>
-
- <A NAME="__index__"></A>
- <!-- INDEX BEGIN -->
-
- <UL>
-
- <LI><A HREF="#name">NAME</A></LI><LI><A HREF="#supportedplatforms">SUPPORTED PLATFORMS</A></LI>
-
- <LI><A HREF="#synopsis">SYNOPSIS</A></LI>
- <LI><A HREF="#incompatibility alert">INCOMPATIBILITY ALERT</A></LI>
- <LI><A HREF="#description">DESCRIPTION</A></LI>
- <UL>
-
- <LI><A HREF="#devel::symdump>rnew(@packages)"><CODE>Devel::Symdump->rnew(@packages)</CODE></A></LI>
- <LI><A HREF="#devel::symdump>new(@packages)"><CODE>Devel::Symdump->new(@packages)</CODE></A></LI>
- </UL>
-
- <LI><A HREF="#subclassing">SUBCLASSING</A></LI>
- <LI><A HREF="#authors">AUTHORS</A></LI>
- </UL>
- <!-- INDEX END -->
-
- <HR>
- <P>
- <H1><A NAME="name">NAME</A></H1>
- <P>Devel::Symdump - dump symbol names or the symbol table</P>
- <P>
- <HR>
- <H1><A NAME="supportedplatforms">SUPPORTED PLATFORMS</A></H1>
- <UL>
- <LI>Linux</LI>
- <LI>Solaris</LI>
- <LI>Windows</LI>
- </UL>
- <HR>
- <H1><A NAME="synopsis">SYNOPSIS</A></H1>
- <PRE>
- # Constructor
- require Devel::Symdump;
- @packs = qw(some_package another_package);
- $obj = Devel::Symdump->new(@packs); # no recursion
- $obj = Devel::Symdump->rnew(@packs); # with recursion
- </PRE>
- <PRE>
-
- # Methods
- @array = $obj->packages;
- @array = $obj->scalars;
- @array = $obj->arrays;
- @array = $obj->hashs;
- @array = $obj->functions;
- @array = $obj->filehandles; # deprecated, use ios instead
- @array = $obj->dirhandles; # deprecated, use ios instead
- @array = $obj->ios;
- @array = $obj->unknowns;</PRE>
- <PRE>
-
- $string = $obj->as_string;
- $string = $obj->as_HTML;
- $string = $obj1->diff($obj2);</PRE>
- <PRE>
- $string = Devel::Symdump->isa_tree; # or $obj->isa_tree
- $string = Devel::Symdump->inh_tree; # or $obj->inh_tree</PRE>
- <PRE>
- # 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->ios(@packs);
- @array = Devel::Symdump->unknowns(@packs);</PRE>
- <P>
- <HR>
- <H1><A NAME="incompatibility alert">INCOMPATIBILITY ALERT</A></H1>
- <P>Perl 5.003 already offered the opportunity to test for the individual
- slots of a GLOB with the *GLOB{XXX} notation. Devel::Symdump version
- 2.00 uses this method internally which means that the type of
- undefined values is recognized in general. Previous versions
- couldn&39;t determine the type of undefined values, so the slot
- <EM>unknowns</EM> was invented. From version 2.00 this slot is still present
- but will usually not contain any elements.</P>
- <P>The interface has changed slightly between the perl versions 5.003 and
- 5.004. To be precise, from perl5.003_11 the names of the members of a
- GLOB have changed. <CODE>IO</CODE> is the internal name for all kinds of
- input-output handles while <CODE>FILEHANDLE</CODE> and <CODE>DIRHANDLE</CODE> are
- deprecated.</P>
- <P><CODE>Devel::Symdump</CODE> accordingly introduces the new method <CODE>ios()</CODE> which
- returns filehandles <STRONG>and</STRONG> directory handles. The old methods
- <CODE>filehandles()</CODE> and <CODE>dirhandles()</CODE> are still supported for a transitional
- period. They will probably have to go in future versions.</P>
- <P>
- <HR>
- <H1><A NAME="description">DESCRIPTION</A></H1>
- <P>This little package serves to access the symbol table of perl.</P>
- <P>
- <H2><A NAME="devel::symdump>rnew(@packages)"><CODE>Devel::Symdump->rnew(@packages)</CODE></A></H2>
- <P>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 <CODE>main</CODE>. That means to get the whole symbol
- table, just do a <CODE>rnew</CODE> without arguments.</P>
- <P>
- <H2><A NAME="devel::symdump>new(@packages)"><CODE>Devel::Symdump->new(@packages)</CODE></A></H2>
- <P>does not go into recursion and only analyzes the packages that are
- given as arguments.</P>
- <P>The methods packages(), scalars(), arrays(), hashes(), functions(),
- ios(), and <CODE>unknowns()</CODE> 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 <CODE>$</CODE>, <CODE>@</CODE> or <CODE>%</CODE>. In
- a scalar context, they will return the number of such symbols.
- Unknown symbols are usually either formats or variables that haven&39;t
- yet got a defined value.</P>
- <P><CODE>As_string()</CODE> and <CODE>as_HTML()</CODE> return a simple string/HTML representations
- of the object.</P>
- <P><CODE>Diff()</CODE> 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.</P>
- <P><CODE>Isa_tree()</CODE> and <A HREF="#item_inh_tree"><CODE>inh_tree()</CODE></A> 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&39;m sure, many users will have different expectation
- about what is top and what is bottom, I&39;ll provide an example what
- happens when the Socket module is loaded:</P>
- <DL>
- <DT><STRONG><A NAME="item_inh_tree">% print Devel::Symdump->inh_tree</A></STRONG><BR>
- <DD>
- <PRE>
- AutoLoader
- DynaLoader
- Socket
- DynaLoader
- Socket
- Exporter
- Carp
- Config
- Socket</PRE>
- <P>The inh_tree method shows on the left hand side a package name and
- indented to the right the packages that use the former.</P>
- <DT><STRONG><A NAME="item_isa_tree">% print Devel::Symdump->isa_tree</A></STRONG><BR>
- <DD>
- <PRE>
- Carp
- Exporter
- Config
- Exporter
- DynaLoader
- AutoLoader
- Socket
- Exporter
- DynaLoader
- AutoLoader</PRE>
- <P>The isa_tree method displays from left to right ISA relationships, so
- Socket IS A DynaLoader and DynaLoader IS A AutoLoader. (At least at
- the time this manpage was written :-)</P>
- </DL>
- <P>You may call both methods, <A HREF="#item_isa_tree"><CODE>isa_tree()</CODE></A> 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.</P>
- <P>
- <HR>
- <H1><A NAME="subclassing">SUBCLASSING</A></H1>
- <P>The design of this package is intentionally primitive and allows it to
- be subclassed easily. An example of a (maybe) useful subclass is
- Devel::Symdump::Export, a package which exports all methods of the
- Devel::Symdump package and turns them into functions.</P>
- <P>
- <HR>
- <H1><A NAME="authors">AUTHORS</A></H1>
- <P>Andreas Koenig <EM><<A HREF="mailto:koenig@franz.ww.TU-Berlin.DE">koenig@franz.ww.TU-Berlin.DE</A>></EM> and Tom
- Christiansen <EM><<A HREF="mailto:tchrist@perl.com">tchrist@perl.com</A>></EM>. Based on the old
- <EM>dumpvar.pl</EM> by Larry Wall.</P>
- <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
- <TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
- <STRONG><P CLASS=block> Devel::Symdump - dump symbol names or the symbol table</P></STRONG>
- </TD></TR>
- </TABLE>
-
- </BODY>
-
- </HTML>
-