NAME
Zwoelf::Hash::Union
DESCRIPTION
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
SYNOPSIS
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 }] },