in reply to Adding data to hashes & comparing

push @AoH, %data

This flattens the hash %data, which is not what you want. Instead push @AoH, \%data, which pushes a (not flat) reference.

Please read perlreftut on how you can use references to build complex data structures.

Replies are listed 'Best First'.
Re^2: Adding data to hashes & comparing
by hallikpapa (Scribe) on Mar 30, 2009 at 20:41 UTC
    Ah. That makes sense. I was wondering what happened. So I have two Arrays, @get_array and @post_array which are array of hashes. What is a more efficient way that doing nested foreach loops for when I do my comparing? That seems like a bunch of uneeded processing, and there might be some kind of seek, or....?