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:
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:$hash{$station}{$row}{$id} = $draw->{Value};
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. :)while ($hash{"STATION2"}{$row}{"ID1"} eq $hash{"STATION3"}{$row}{"ID1" +) { ........ }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Help me understand hashes
by graff (Chancellor) on Nov 16, 2007 at 01:41 UTC | |
Re: Help me understand hashes
by GrandFather (Saint) on Nov 16, 2007 at 02:24 UTC | |
by hallikpapa (Scribe) on Nov 16, 2007 at 17:54 UTC | |
Re: Help me understand hashes
by ysth (Canon) on Nov 16, 2007 at 01:53 UTC | |
Re: Help me understand hashes
by planetscape (Chancellor) on Nov 17, 2007 at 10:53 UTC | |
Re: Help me understand hashes
by injunjoel (Priest) on Nov 17, 2007 at 01:18 UTC |
Back to
Seekers of Perl Wisdom