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,
Thanks for everyone who took time and effort to answer my question, as well as giving pointers to how it can be solved.

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.