1PPI::Dumper(3)        User Contributed Perl Documentation       PPI::Dumper(3)
2
3
4

NAME

6       PPI::Dumper - Dumping of PDOM trees
7

SYNOPSIS

9         # Load a document
10         my $Module = PPI::Document->new( 'MyModule.pm' );
11
12         # Create the dumper
13         my $Dumper = PPI::Dumper->new( $Module );
14
15         # Dump the document
16         $Dumper->print;
17

DESCRIPTION

19       The PDOM trees in PPI 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 partic‐
25       ular set of options, and then call one of the dump methods to generate
26       the dump content itself.
27

METHODS

29       new $Element, param => value, ...
30
31       The "new" constructor creates a dumper, and takes as argument a single
32       PPI::Element object of any type to serve as the root of the tree to be
33       dumped, and a number of key->value parameters to control the output
34       format of the Dumper. Details of the parameters are listed below.
35
36       Returns a new "PPI::Dumper" object, or "undef" if the constructor is
37       not passed a correct PPI::Element root object.
38
39       memaddr
40           Should the dumper print the memory addresses of each PDOM element.
41           True/false value, off by default.
42
43       indent
44           Should the structures being dumped be indented. This value is
45           numeric, with the number representing the number of spaces to use
46           when indenting the dumper output. Set to '2' by default.
47
48       class
49           Should the dumper print the full class for each element.
50           True/false value, on by default.
51
52       content
53           Should the dumper show the content of each element. True/false
54           value, on by default.
55
56       whitespace
57           Should the dumper show whitespace tokens. By not showing the copi‐
58           ous numbers of whitespace tokens the structure of the code can
59           often be made much clearer. True/false value, on by default.
60
61       comments
62           Should the dumper show comment tokens. In situations where you have
63           a lot of comments, the code can often be made clearer by ignoring
64           comment tokens. True/value value, on by default.
65
66       locations
67           Should the dumper show the location of each token. The values shown
68           are [ line, rowchar, column ]. See "location" in PPI::Element for a
69           description of what these values really are. True/false value, off
70           by default.
71
72       print
73
74       The "print" method generates the dump and prints it to STDOUT.
75
76       Returns as for the internal print function.
77
78       string
79
80       The "string" method generates the dump and provides it as a single
81       string.
82
83       Returns a string or undef if there is an error while generating the
84       dump.
85
86       list
87
88       The "list" method generates the dump and provides it as a raw list,
89       without trailing newlines.
90
91       Returns a list or the null list if there is an error while generation
92       the dump.
93

SUPPORT

95       See the support section in the main module.
96

AUTHOR

98       Adam Kennedy <adamk@cpan.org>
99
101       Copyright 2001 - 2006 Adam Kennedy.
102
103       This program is free software; you can redistribute it and/or modify it
104       under the same terms as Perl itself.
105
106       The full text of the license can be found in the LICENSE file included
107       with this module.
108
109
110
111perl v5.8.8                       2006-09-23                    PPI::Dumper(3)
Impressum