http://www.perlmonks.org?node_id=651103

hallikpapa has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks. Back with a question again. I have loaded a bunch of data into a hash like so in a loop:
$hash{$station}{$row}{$id} = $draw->{Value};
So all data from a file is in that multidimensional hash. What I want to do is compare different data from different $station(s). STATION3 will have a many relationship to one STATION2, and STATION4 will have a many relationship to one STATION3, etc... For instance I drew this on my scratch pad, which doesn't work right, but might help explain what I am looking for:
while ($hash{"STATION2"}{$row}{"ID1"} eq $hash{"STATION3"}{$row}{"ID1" +) { ........ }
Example: I want to compare every ID value at STATION3 to see if it matches the ID value at STATION2, if it matches, do something... So if I have all data from a huge file organized nicely in this hash, how would I jump through this hash efficiently? Not asking for a handout here, just always get my butt kicked trying to look at hashes and once in a while regex(s), but the ilovejackdaniels cheat sheet helps with that one. :)