Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

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?

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2015-10-10 20:19 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (258 votes), past polls