I have spent days reading and testing hashes and arrays and would appreciate if someone could please just point me in the right direction.

I am writing a script that will process multiple log files to look for a maximum value in each. Once found, I need to compare that max value found in each log file to it's corresponding max value stored in a CSV file.

My question:

What memory structure would be best suited to storing this data ? (Array of Hashes, Hash of Hashes etc) (Maximum Log File)

DOW,Sep,18,09:31:16,440,29,142,10148,4

Russell2000,Sep,18,09:31:16,440,29,142,10148,4

RussellComposite,Sep,18,09:31:16,440,29,142,10148,4

Russell1000,Sep,18,09:31:16,440,29,142,10148,4

SP500,Sep,18,09:31:16,440,29,142,10148,4

Additional info:

1. The process files provide the category (ie DOW, SP500 etc) and I will be comparing the processed max value against the 7th element of the CSV file for the specific category.

2. If the maximum processed value is greater than the value currently stored in the CSV file, then I need to ultimately update the row in the CSV file.

3. When all file processing is complete, I need to sort the memory structure in ascending order on the 7th element then output back to a CSV file.

Please let me know if additional info is needed.

Thanks


In reply to Hashes and Arrays - Selecting a memory structure by tdudgeon

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.