Config-Hierarchical
view release on metacpan or search on metacpan
lib/Config/Hierarchical/Delta.pm view on Meta::CPAN
"Delta between '$lhs_name' and '$rhs_name'':",
DISPLAY_ADDRESS => 0,
@other_arguments_to_data_treedumper
) ;
}
#-------------------------------------------------------------------------------
sub Get_NoIdentical_Filter
{
=head2 Get_NoIdentical_Filter
Dumping a config delta with:
print DumpConfigHierarchicalDelta($config_2, $config_0) ;
Gives:
$expected_dump = <<EOD ;
Delta between 'config 2' and 'config 0'':
|- different
| `- CC1
| |- config 0 = 1
| `- config 2 = A
|- identical
| `- CC2 = 2
`- in 'config 2' only
|- CC3 = 3
`- XYZ = xyz
if you do not want to display the configuration variables that are identical, use:
print DumpConfigHierarchicalDelta($config_2, $config_0, Get_NoIdentical_Filter()) ;
which gives:
my $expected_dump = <<EOD ;
Delta between 'config 2' and 'config 0'':
|- different
| `- CC1
| |- config 0 = 1
| `- config 2 = A
`- in 'config 2' only
|- CC3 = 3
`- XYZ = xyz
EOD
Returns a L<Data::TreeDumper> filter you can use to remove the 'identical' element from the delta hash.
=cut
return (LEVEL_FILTERS => {0 => sub {my $s = shift ; return('HASH', undef, grep {$_ ne 'identical'} keys %{$s})}}) ;
}
#-------------------------------------------------------------------------------
1 ;
=head1 BUGS AND LIMITATIONS
None so far.
=head1 AUTHOR
Khemir Nadim ibn Hamouda
CPAN ID: NKH
mailto:nadim@khemir.net
=head1 LICENSE AND COPYRIGHT
Copyright 2006-2007 Khemir Nadim. All rights reserved.
This program is free software; you can redistribute
it and/or modify it under the same terms as Perl itself.
=head1 SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Config::Hierarchical
You can also look for information at:
=over 4
=item * AnnoCPAN: Annotated CPAN documentation
L<http://annocpan.org/dist/Config-Hierarchical>
=item * RT: CPAN's request tracker
Please report any bugs or feature requests to L <bug-config-hierarchical@rt.cpan.org>.
We will be notified, and then you'll automatically be notified of progress on
your bug as we make changes.
=item * Search CPAN
L<http://search.cpan.org/dist/Config-Hierarchical>
=back
=head1 SEE ALSO
=cut
( run in 2.583 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )