Data-TreeDumper-Utils
view release on metacpan or search on metacpan
'Text::Diff' => 0,
'Test::Block' => 0,
'Test::Exception' => 0,
'Test::NoWarnings' => 0,
'Test::Warn' => 0,
},
requires =>
{
'Readonly' => 0,
'Sub::Exporter' => 0,
'Sort::Naturally' => 0,
'Check::ISA' => 0,
'Tie::IxHash' => 0,
'Data::TreeDumper' => 0.35,
'Sub::Uplevel' => 0.20,
},
pm_files => \%all_modules,
autosplit => \@split_modules,
#~ script_files => 'scripts/script.pl',
"configure" : {
"requires" : {
"Module::Build" : "0.42"
}
},
"runtime" : {
"requires" : {
"Check::ISA" : "0",
"Data::TreeDumper" : "0.35",
"Readonly" : "0",
"Sort::Naturally" : "0",
"Sub::Exporter" : "0",
"Sub::Uplevel" : "0.2",
"Tie::IxHash" : "0"
}
}
},
"provides" : {
"Data::TreeDumper::Utils" : {
"file" : "lib/Data/TreeDumper/Utils.pm",
"version" : "0.04"
version: '1.4'
name: Data-TreeDumper-Utils
provides:
Data::TreeDumper::Utils:
file: lib/Data/TreeDumper/Utils.pm
version: '0.04'
requires:
Check::ISA: '0'
Data::TreeDumper: '0.35'
Readonly: '0'
Sort::Naturally: '0'
Sub::Exporter: '0'
Sub::Uplevel: '0.2'
Tie::IxHash: '0'
resources:
license: http://dev.perl.org/licenses/
version: v0.04.4
lib/Data/TreeDumper/Utils.pm view on Meta::CPAN
all => [ qw(first_nsort_last_filter keys_order no_sort_filter hash_keys_sorter filter_class_keys get_caller_stack) ],
}
};
use vars qw ($VERSION);
$VERSION = '0.04';
}
#-------------------------------------------------------------------------------
use Sort::Naturally;
use Check::ISA ;
use Readonly ;
Readonly my $EMPTY_STRING => q{} ;
#-------------------------------------------------------------------------------
=head1 NAME
Data::TreeDumper::Utils - A selection of utilities to use with Data::TreeDumper
lib/Data/TreeDumper/Utils.pm view on Meta::CPAN
=item * AT_START - the keys that should be rendered next, will be sorted
=item * AT_END - the keys that should be rendered last, will be sorted
=item * AT_END_FIXED - the keys that should be rendered at the end, will not be sorted
=back
Any key that doesn't match a regex or a string will automatically be in this category.
Keys are sorted by L<Sort::Naturally>.
B<Returns> - the keys sorted according to the defined categories.
B<See> - I<Filters> in L<Data::TreeDumper>.
=cut
my ($structure, undef, undef, $nodes_to_display, undef, $filter_argument) = @_ ;
if('HASH' eq ref $structure || obj($structure, 'HASH'))
lib/Data/TreeDumper/Utils.pm view on Meta::CPAN
}
}
#-------------------------------------------------------------------------------
sub hash_keys_sorter
{
=head2 hash_keys_sorter()
When no filter is given to L<Data::TreeDumper>, it will sort hash keys using L<Sort::Naturally>. If you create your
own filter or have chaining filters, you will have to do the sorting yourself (if you want keys to be sorted) or you can
use this filter to do the sorting.
# Remove keys starting with A, return in keys in the order the hash returns them
DumpTree($s, 'not sorted', FILTER => \&remove_keys_starting_with_A,) ;
# Remove keys starting with A, sort keys
DumpTree
(
$s,
( run in 2.376 seconds using v1.01-cache-2.11-cpan-e93a5daba3e )