in reply to Re: Messing about in Arrays of Hashes
in thread Messing about in Arrays of Hashes

Additional note - if you wish to edit this code for other arrays of hashes, just change the following lines:

Creates unique ID:

    $id = @$var[$i]->{'id_a'} . ' ' . @$var[$i]->{'id_b'};

Merges data:

$ids{$id}->{'value_x'} += @$var[$i]->{'value_x'}; $ids{$id}->{'value_y'} += @$var[$i]->{'value_y'};