Zwoelf::Hash::Union
Work in progress: Menat to merge to hashes together like Hash::Merge BUT will produce unions of any arrays that occur under the same key
use Zwoelf::Hash::Union qw( merge_hash unique_array ); unique_array([ {a=>1}, {b=>2}, {c=>3}, {b=>2} ]) # yields [{ a => 1 }, { b => 2 }, { c => 3 }]; merge_hash( { a => 1, b => [{ b => 2 }, { c => 3 }] }, { a => 2, b => [{ b => 2 }, { d => 4 }] }, ); # yields { a => 2, b => [{ b => 2}, { c => 3 }, { d => 4 }] }, merge_hash( { a => 1, b => [{ b => 2 }, { c => 3 }] }, { a => 2, b => [{ b => 2 }, { d => 4 }] }, 'LEFT_PRECEDENT' ); # yields { a => 1, b => [{ b => 2}, { c => 3 }, { d => 4 }] },
To install Zwoelf::Hash::Union, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Zwoelf::Hash::Union
CPAN shell
perl -MCPAN -e shell install Zwoelf::Hash::Union
For more information on module installation, please visit the detailed CPAN module installation guide.