Hi,
I wish to associate a list of coordinates with a list of zones. The zones take the following form -
B1, B2, B3, BR4, I22, IJ1, IJ17....etc.
The coorinates take the form - 1:23,7:59. I was thinking of storing the coorinates as a four dim array - [a1,a2,b1,b2] = [1,23,7,59]. Each zone has a abritary number of coordinates associated with it, such as B1 = [11,21,3,59],[1,23,7,51],[9,2,11,9].

How would I declare a hash to store this type of data? I'd like to add the coordinates on the fly, something like -

for($a1=0;$a1<60;$a1++){ for($a2=0;$a2<60;$a2++){ for($b1=0;$b1<60;$b1++){ for($b2=0;$b2<60;$b2++){ $zone = Get_zone_for_this_coordinate($a1,$a2,$b1,$b2)}; Add_this_coordinate_to_the_hash_for_hash_member_$zone; } } } }
How might I do this?
Thanks.

edited: Sat Nov 15 16:55:49 2003 by jeffa - formatting, code tags


In reply to Hashing multiple items by Anonymous Monk

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.