Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Please help, (perl hash)

by SimonClinch (Chaplain)
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


Comment on Re: Please help, (perl hash)
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://905082]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2014-09-02 02:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (18 votes), past polls