NAME
Data::Format::Pretty - Pretty-print data structure
VERSION
version 0.01
SYNOPSIS
In your program:
use Data::Format::Pretty qw(format_pretty);
print format_pretty($data, 'Console', {interactive=>1});
DESCRIPTION
Data::Format::Pretty is an extremely simple framework for pretty-printing data structure. Its focus is on "prettiness" and automatic detection of appropriate format to use.
To use this framework, install one or more Data::Format::Pretty::* formatter modules, and call format_pretty($data, $formatter, $opts). Data::Format::Pretty will delegate formatting to the formatting module, passing $data as well as format-specific options ($opts).
To develop a formatter, look at one of the formatter module (like Data::Format::Pretty::JSON) for example. You only need to specify one function, format_pretty
.
FUNCTIONS
format_pretty($data, \%opts) => STR
Send $data to formatter module (one of Data::Format::Pretty::* modules) and return the result. Options:
module => STR
Select the formatter module. It will be prefixed with "Data::Format::Pretty::".
Currently if unspecified the default is 'Console', or 'HTML' if CGI/PSGI/plackup environment is detected. In the future, more sophisticated detection logic will be used.
The rest of the options will be passed to the formatter module.
SEE ALSO
One of Data::Format::Pretty::* formatter, like Data::Format::Pretty::Console, Data::Format::Pretty::HTML, Data::Format::Pretty::JSON, Data::Format::Pretty::YAML.
AUTHOR
Steven Haryanto <stevenharyanto@gmail.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2011 by Steven Haryanto.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.