I have been working in a perl code and been having a problem, especially in using the "hash". I am a newbie in perl, i would appreciate some help.
This is a simple scenario...
We have Town A to Z and they have streets 1 to 9 and each street has different number of houses...
I would like to find out how to represent the data- eg. G6 = number of houses in town G street 6...
and such information sassociated with the keys? PLease help?
Update
Dear perlmonks,
Just to correct thezip who says this is a homework, it actually isnt homework. I actually am not a student, and was programming before i got to the point i dint know how to express the "hash-a-hash" scenario where, some things change (eg towns and stret names) but some value associated with it doesnt change- (all streets in all towns have a house(s)) - probably the reason I re edited the question to something about mutants and all which was more complicated but i[ agree the house scenario was teh simplest and best way i could think of expressing the idea.
I wouldnt have had a problem pasted my code upto the point of hashes, but what i was coding was nothing related to houses, so i just simplified into the scenario, since i knew the exact problem i hit and what i wanted to solve.
I have managed to follow through and i appreciate the help, with the bits and pieces of code, and pointers of wisdom, and I pass my thanks to sundial for the really cool explanation, toolic, javafun, AnomalousMonk, anonymized user 468275 -- who by the way just showed a new approach in case any of use run into such a scenario :) And Of course, Thanks mariner :)
NB i am new, i dont know yet how to start a thread, so i end up overwriting the initial post (sorry Mariner!)
In reply to Please help, (perl hash) by degit
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |