Hmm, I'm realizing that I'm not being entirely clear.

Say you don't have data for *every* (or every month, year, etc), so you only want those days/months/years in %weather_archive for which you have data.

So, I'm assuming you'll want to iterate through the original array of hashes, pulling out unique values for days/months/years.

To simplify this, let's say I've munged the data a bit, and now my hashes looks like this:

%weather_day = ( Year => "2003", Month => "April", Day => "15", High => "73f", Low => "49f" ); push (@weather_days, %weather_day);

How can I extract the unique year/month/day values, and then programmatically build up the %weather_archive hash?

Once I have %weather_archive, how can I print it so that it looks something like this?

2003 April 15 High: 73f Low: 49f

In reply to Re: Re: Re: Re: 3D array of hashes by ManyCrows
in thread 3D array of hashes by ManyCrows

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.