Data::NeatDump - stringified perl data structures for human eyes
use Data::NeatDump;
print dump([1, 2, [ 3, 4 ]], { 'a' .. 'z' }, 42);
or:
use Data::NeatDump;
set_dump_indent_size(3);
set_dump_level_limit(4);
set_dump_array_limit(8);
set_dump_line_prefix("| ");
set_dump_type_naming(1);
set_dump_quotes_mode(1);
my $output = Dump($var1, $var2);
or:
use Data::NeatDump qw(:informative :perl Dump);
or:
use Data::NeatDump (quotes_mode => 2, indent_size => 2);
Given a list of scalars or references or objects, writes out their contents in human readable form. The reference type (like ``ARRAY'', ``HASH'') and object type (like ``Dog'', ``Podius::Component'') is shown in the output, as well as the recursive content.
The main function is available under several names: dump (be aware that there is a standard perl function of this name, but it is masked), Dump and get_data_dump. Also it is optionally available under name perl (should be imported explicitly).
Note, this module is not indented to be used for perl data serialization.
The following functions are exported by default:
dump, Dump, get_data_dump, print_data_dump, set_dump_indent_size, set_dump_level_limit, set_dump_array_limit, set_dump_line_prefix, set_dump_type_naming, set_dump_quotes_mode.
Modules may request importing only one function, say Dump or perl.
There is no line prefix by default, but it may be set (try ``[dump] ''). Also, by default hashs and arrays are not prefixed with strings like ``HASH '', you may turn it on. The quotes around values may be controlled by setting mode 1 (don't quote numbers and keys if possible), 2 (don't quote numbers) and 3 (always use quotes).
Mikhael Goikhman (migo@cpan.org)
For a more serialization-like functionality, see the Data::Dumper manpage.