Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Please help, (perl hash)

by SimonClinch (Deacon)
on May 16, 2011 at 14:09 UTC ( #905082=note: print w/replies, xml ) Need Help??


in reply to Please help, (perl hash)

Normally the hash of hash as stated. But there is interestingly an array of array option for this very specific case where the towns and streets are nameless and have a contiguous identification system. For example
$array[ ord( $town ) - 65 ][ $street - 1 ] = $houses;
the expression involving ord converts the town letter into its corresponding position in the outer array and the inner array needs only the subtraction of one to map streets 1-9 to their array indexes in Perl.

One world, one people

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://905082]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2016-12-09 02:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (148 votes). Check out past polls.