Your problem is not one of referencing your data structure, but rather one of creating it. I think you want a stucture that you can reference as:
$date = $myarr[$index][$subindex];

where $date is a reference to an array of ten integers and ($index, $subindex) is a pair of integers each in range 0..99.

With your data, you cannot assume that $index, $subindex, or the pair ($index, $subindex) are unique. The best solution very much depends on how you need to handle these special cases. I would only be adding to your confusion if I attempted to answer your original question before you clarify this issue.

The use of an array-of-arrays, as the reference above requires, has another problem. The arrays are very sparse. Refering to your data, the entire structure only stores fifteen dates. This is not a serious problem yet, but it would not scale up well if your array size were to increase. We seldom use hashes with integer keys, but it seems to be the perfect solution to this problem.

Bill

In reply to Re: Adding cols to 3d arrays - syntax by BillKSmith
in thread Adding cols to 3d arrays - syntax by peterrowse

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.