Hash::Diff(3pm)

Hash::Diff3pm

Return difference between two hashes as a hash

Usage

    use Hash::Diff qw( diff );
    my %a = ( 
                'foo'    => 1,
            'bar'    => { a => 1, b => 1 },
        );
    my %b = ( 
                'foo'     => 2, 
                'bar'    => { a => 1 },
        );
    my %c = %{ diff( \%a, \%b ) };
    
    # %c = %{ foo => 1, bar => { b => 1} }

Overview

Hash::Diff returns the difference between two hashes as a hash.

diff ( <hashref>, <hashref> )

Diffs two hashes. Returns a reference to the new hash.

left_diff ( <hashref>, <hashref> )

Returns the values in the left hash that is not, or different from the right hash.

Caveats

This will not handle self-referencing/recursion within hashes well. This will only handle HASH and SCALAR.

Plans for a future version include incorporate deep recursion protection. And support for ARRAY.

Contributor

Charles McGarvey <[email protected]>

Releases

6 releases since Debian 8 (Jessie); the text changed 3 times.

  1. 8
  2. 9
  3. 10–11
  4. 12–13

Bugs

Sure! Report here: http://rt.cpan.org/NoAuth/Bugs.html?Dist=Hash::Diff

Author

Bjorn-Olav Strand <[email protected]>

From libhash-diff-perl 0.010-2 in Debian 13 (Trixie). Parsed by carta from the page's man source.