I'd go for a HoH, although a HoA would work. Consider:

use strict; use warnings; use Text::CSV; my %lookup; my $csv = Text::CSV->new (); my $filename = 'DATA'; while (<DATA>) { next unless $csv->parse ($_); my @row = $csv->fields (); next unless @row >= 7; my $key = $row[0]; next if exists $lookup{$key} && $row[7] <= $lookup{$key}{max}; $lookup{$key} = {max => $row[7], line => $., file => $filename}; } print "Following maximums found:\n"; print "$_ = $lookup{$_}{max} in file $lookup{$_}{file}, line $lookup{$ +_}{line}\n" for sort keys %lookup; __DATA__ 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 Russell2000,Sep,18,09:31:16,440,29,142,10120,4 SP500,Sep,18,09:31:16,440,29,142,10160,4

Prints:

Following maximums found: DOW = 10148 in file DATA, line 1 Russell1000 = 10148 in file DATA, line 4 Russell2000 = 10148 in file DATA, line 2 RussellComposite = 10148 in file DATA, line 3 SP500 = 10160 in file DATA, line 7

Perl is environmentally friendly - it saves trees

In reply to Re: Hashes and Arrays - Selecting a memory structure by GrandFather
in thread 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.