Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

mdom::dumper(3pm) [debian man page]

MDOM::Dumper(3pm)					User Contributed Perl Documentation					 MDOM::Dumper(3pm)

NAME
MDOM::Dumper - Dumping of MDOM trees SYNOPSIS
# Load a document my $Module = MDOM::Document->new( 'MyMakefile' ); # Create the dumper my $Dumper = MDOM::Dumper->new( $Module ); # Dump the document $Dumper->print; DESCRIPTION
The MDOM trees in MDOM are quite complex, and getting a dump of their structure for development and debugging purposes is important. This module provides that functionality. The process is relatively simple. Create a dumper object with a particular set of options, and then call one of the dump methods to generate the dump content itself. METHODS
new $Element, param => value, ... The "new" constructor creates a dumper, and takes as argument a single MDOM::Element object of any type to serve as the root of the tree to be dumped, and a number of key->value parameters to control the output format of the Dumper. Details of the parameters are listed below. Returns a new "MDOM::Dumper" object, or "undef" if the constructor is not passed a correct MDOM::Element root object. memaddr Should the dumper print the memory addresses of each MDOM element. True/false value, off by default. indent Should the structures being dumped be indented. This value is numeric, with the number representing the number of spaces to use when indenting the dumper output. Set to '2' by default. class Should the dumper print the full class for each element. True/false value, on by default. content Should the dumper show the content of each element. True/false value, on by default. whitespace Should the dumper show whitespace tokens. By not showing the copious numbers of whitespace tokens the structure of the code can often be made much clearer. True/false value, on by default. comments Should the dumper show comment tokens. In situations where you have a lot of comments, the code can often be made clearer by ignoring comment tokens. True/value value, on by default. locations Should the dumper show the location of each token. The values shown are [ line, rowchar, column ]. See "location" in MDOM::Element for a description of what these values really are. True/false value, off by default. print The "print" method generates the dump and prints it to STDOUT. Returns as for the internal print function. string The "string" method generates the dump and provides it as a single string. Returns a string or undef if there is an error while generating the dump. list The "list" method generates the dump and provides it as a raw list, without trailing newlines. Returns a list or the null list if there is an error while generation the dump. SUPPORT
See the support section in the main module. AUTHOR
Adam Kennedy <adamk@cpan.org> Zhang "agentzh" Yichun "<agentzh@gmail.com>" COPYRIGHT
Copyright 2001 - 2006 Adam Kennedy. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. perl v5.12.4 2011-08-28 MDOM::Dumper(3pm)

Check Out this Related Man Page

MDOM::Token::Whitespace(3pm)				User Contributed Perl Documentation			      MDOM::Token::Whitespace(3pm)

NAME
MDOM::Token::Whitespace - Tokens representing ordinary white space INHERITANCE
MDOM::Token::Whitespace isa MDOM::Token isa MDOM::Element DESCRIPTION
As a full "round-trip" parser, MDOM records every last byte in a file and ensure that it is included in the MDOM::Document object. This even includes whitespace. In fact, Perl documents are seen as "floating in a sea of whitespace", and thus any document will contain vast quantities of "MDOM::Token::Whitespace" objects. For the most part, you shouldn't notice them. Or at least, you shouldn't have to notice them. This means doing things like consistently using the "S for significant" series of MDOM::Node and MDOM::Element methods to do things. If you want the nth child element, you should be using "schild" rather than "child", and likewise "snext_sibling", "sprevious_sibling", and so on and so forth. METHODS
Again, for the most part you should really not need to do anything very significant with whitespace. But there are a couple of convenience methods provided, beyond those provided by the parent MDOM::Token and MDOM::Element classes. null Because MDOM sees documents as sitting on a sort of substrate made of whitespace, there are a couple of corner cases that get particularly nasty if they don't find whitespace in certain places. Imagine walking down the beach to go into the ocean, and then quite unexpectedly falling off the side of the planet. Well it's somewhat equivalent to that, including the whole screaming death bit. The "null" method is a convenience provided to get some internals out of some of these corner cases. Specifically it create a whitespace token that represents nothing, or at least the null string ''. It's a handy way to have some "whitespace" right where you need it, without having to have any actual characters. tidy "tidy" is a convenience method for removing unneeded whitespace. Specifically, it removes any whitespace from the end of a line. Note that this doesn't include POD, where you may well need to keep certain types of whitespace. The entire POD chunk lives in its own MDOM::Token::Pod object. SUPPORT
See the support section in the main module. AUTHOR
Adam Kennedy <adamk@cpan.org> COPYRIGHT
Copyright 2001 - 2006 Adam Kennedy. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. perl v5.12.4 2011-08-28 MDOM::Token::Whitespace(3pm)
Man Page