NAME
Data::Skeleton - Show the keys of a deep data structure
SYNOPSIS
use Data::Skeleton;
my $ds = Data::Skeleton->new;
my $deep_data_structure = {
id => 'blahblahblah',
last_modified => 1,
sections => [
{
content => 'h1. Ice Cream',
class => 'textile'
},
{
content => '# Chocolate',
class => 'markdown'
},
],
};
use Data::Dumper::Concise;
print Dumper $ds->deflesh($deep_data_structure);
# results in:
{
id => "",
last_modified => "",
sections => [
{
class => "",
content => ""
},
{
class => "",
content => ""
}
]
}
DESCRIPTION
Sometimes you just want to see the "schema" of a data structure. This modules shows only the keys with blanks for the values.
METHODS
deflesh
Signature: (HashRef|ArrayRef)
Returns: The data structure with values blanked
SEE ALSO
Data::Dump::Partial is way more feature rich than this module. The only reason I didn't use it is that the output is all on one line. To get something similar to deflesh with Data::Dump::Partial do:
say Dumper dump_partial($data, {max_total_len => $big_enough_number, max_len => 0});
The important part being max_len = 0
This module was inspired when I wanted to see the "schema" of a MongoDB document. If you want to enforce a schema (and have a place to recall its nature) then you might consider Data::Schema