in reply to Messing about in Arrays of Hashes

Would you ever have an AoH like the following, and if so, what would be the right thing to do with it?
{ id_a => 1 id_b => 2 value_x => 20 value_y => 30 } { id_a => 3 id_b => 4 value_x => 40 value_y => 50 } { id_a => 1 id_b => 4 value_x => 100 value_y => 200 }
Would you want "id_a==1" to come out with 120, and "id_b==4" to come out with 250? Or do you need to keep track if of distinct "id_a/b" tuples?

Replies are listed 'Best First'.
Re^2: Messing about in Arrays of Hashes
by nzgrover (Scribe) on Sep 21, 2004 at 04:37 UTC
    Only if BOTH id's match do i then want to add any corresponding values together and knock out the "duplicate" hash.