PPI::Dumper(3) | User Contributed Perl Documentation | PPI::Dumper(3) |
PPI::Dumper - Dumping of PDOM trees
# Load a document my $Module = PPI::Document->new( 'MyModule.pm' ); # Create the dumper my $Dumper = PPI::Dumper->new( $Module ); # Dump the document $Dumper->print;
The PDOM trees in PPI 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.
The "new" constructor creates a dumper, and takes as argument a single PPI::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 "PPI::Dumper" object, or "undef" if the constructor is not passed a correct PPI::Element root object.
The "print" method generates the dump and prints it to STDOUT.
Returns as for the internal print function.
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.
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 generating the dump.
See the support section in the main module.
Adam Kennedy <adamk@cpan.org>
Copyright 2001 - 2011 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.
2019-07-09 | perl v5.34.0 |