in reply to Please help, (perl hash)
The “value” of a hash-entry can be “a reference to” something else, e.g. another hash. Furthermore, there can be more than one “reference to” the same piece of data, all of which lead to the same thing. This gives you a very flexible way to create multi-dimensional structures.
For instance, in your problem ... you have “towns” that refer to “streets” that refer to “houses.” It really doesn’t matter that street-names are presently “1 to 9.”   (The city fathers might come up with a new scheme tomorrow night, and you don’t want that to break your code.) The only requirement should be that the various names are unique within their respective “containers.” (“Cherry” street in Maryvale, is not Cherry street in Lombard.)
So, your Perl code might have constructions like this ...
$map->{$town}->{$street}->{$house} ...
Also note that any relational database structures that are used to populate these in-memory data structures do not have to have the same topology, and they frequently won’t.