for my $anonhash ( @AoH ) { $master_hash{ $$anonhash{id_a} } += $$anonhash{value_x}; $master_hash{ $$anonhash{id_b} } += $$anonhash{value_y}; }