1MDOM::Dumper(3) User Contributed Perl Documentation MDOM::Dumper(3)
2
3
4
6 MDOM::Dumper - Dumping of MDOM trees
7
9 # Load a document
10 my $Module = MDOM::Document->new( 'MyMakefile' );
11
12 # Create the dumper
13 my $Dumper = MDOM::Dumper->new( $Module );
14
15 # Dump the document
16 $Dumper->print;
17
19 The MDOM trees in MDOM are quite complex, and getting a dump of their
20 structure for development and debugging purposes is important.
21
22 This module provides that functionality.
23
24 The process is relatively simple. Create a dumper object with a
25 particular set of options, and then call one of the dump methods to
26 generate the dump content itself.
27
29 new $Element, param => value, ...
30 The "new" constructor creates a dumper, and takes as argument a single
31 MDOM::Element object of any type to serve as the root of the tree to be
32 dumped, and a number of key->value parameters to control the output
33 format of the Dumper. Details of the parameters are listed below.
34
35 Returns a new "MDOM::Dumper" object, or "undef" if the constructor is
36 not passed a correct MDOM::Element root object.
37
38 memaddr
39 Should the dumper print the memory addresses of each MDOM element.
40 True/false value, off by default.
41
42 indent
43 Should the structures being dumped be indented. This value is
44 numeric, with the number representing the number of spaces to use
45 when indenting the dumper output. Set to '2' by default.
46
47 class
48 Should the dumper print the full class for each element.
49 True/false value, on by default.
50
51 content
52 Should the dumper show the content of each element. True/false
53 value, on by default.
54
55 whitespace
56 Should the dumper show whitespace tokens. By not showing the
57 copious numbers of whitespace tokens the structure of the code can
58 often be made much clearer. True/false value, on by default.
59
60 comments
61 Should the dumper show comment tokens. In situations where you have
62 a lot of comments, the code can often be made clearer by ignoring
63 comment tokens. True/value value, on by default.
64
65 locations
66 Should the dumper show the location of each token. The values shown
67 are [ line, rowchar, column ]. See "location" in MDOM::Element for
68 a description of what these values really are. True/false value,
69 off by default.
70
71 print
72 The "print" method generates the dump and prints it to STDOUT.
73
74 Returns as for the internal print function.
75
76 string
77 The "string" method generates the dump and provides it as a single
78 string.
79
80 Returns a string or undef if there is an error while generating the
81 dump.
82
83 list
84 The "list" method generates the dump and provides it as a raw list,
85 without trailing newlines.
86
87 Returns a list or the null list if there is an error while generation
88 the dump.
89
91 See the support section in the main module.
92
94 Adam Kennedy <adamk@cpan.org>
95
96 Yichun "agentzh" Zhang "<agentzh@gmail.com>"
97
99 Copyright 2001 - 2006 Adam Kennedy.
100
101 This program is free software; you can redistribute it and/or modify it
102 under the same terms as Perl itself.
103
104 The full text of the license can be found in the LICENSE file included
105 with this module.
106
107
108
109perl v5.30.1 2020-01-30 MDOM::Dumper(3)