MDOM::Dumper(3pm)
π MDOM::Dumper β the MDOM::Dumper(3pm) page, bestie edition π
User Contributed Perl Documentation β¨ yes we're in the perl corner of the internet, welcome, sit down, hydrate π«Ά
πΈ NAME πΈ
MDOM::Dumper β dumping of MDOM trees π like, we take the tree and we dump it, and it's giving data π
β¨ SYNOPSIS β¨
# Load a document
my $Module = MDOM::Document->new( 'MyMakefile' );
# Create the dumper
my $Dumper = MDOM::Dumper->new( $Module );
# Dump the document
$Dumper->print;
three lines, one dumper, zero drama π¦
π DESCRIPTION π
okay so. the MDOM trees inside MDOM are quite complex β genuinely, they're a whole situation π β and being able to dump their structure for development and debugging purposes? super important. iconic, even.
this module provides that functionality. that's the whole job. no cap. π
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. that's it. that's the workflow. periodt. π
π METHODS π
π new $Element, param => value, ...
the new constructor creates a dumper π§ and it takes as argument a single MDOM::Element object of any type to serve as the root of the tree to be dumped, plus 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. (no root, no dumper, that's the rule π€)
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, and the number represents how many spaces to use when indenting the dumper output. set to'2'by default β¨ (two spaces, we love a tidy little indent π)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 π (yes, the original really says "true/value value", we're keeping it, it's part of the lore π«Ά)locationsβ should the dumper show the location of each token? the values shown are[ line, rowchar, column ]. see"location"inMDOM::Elementfor 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 π (yes, that's it, that's the whole support section, go check the main module, iykyk)
π AUTHOR π
- Adam Kennedy
<adamk@cpan.org>π - Yichun "agentzh" Zhang
"<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 π
and that's the whole page bestie, no skips, no shortcuts, every option accounted for π
this little number comes to you from perl v5.34.0, dated 2022-06-15, and yes we're signing off like the icons we are πβ¨ ππ¦πΈπ
π¦ where this page comes from
- debian bookworm: libmakefile-dom-perl 0.008-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libmakefile-dom-perl 0.008-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libmakefile-dom-perl 0.008-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libmakefile-dom-perl 0.008-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libmakefile-dom-perl 0.008-3 Β· 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