Thanks to autovivication you could just add a hash or array inbetween. Here for example a hash:

push( @{ $gene_hash{$gene_key}{'start'} }, $start ); push( @{ $gene_hash{$gene_key}{'end'} }, $end ); .... my $Lowstart=min( @{$gene_hash{$key}{'start'} } );

By the way, if the data files are really big, it might be beneficial to find the minimums and maximums directly instead of first storing arrays of all the values. I.e. instead of pushing the value into an array while reading the file compare it to the last value stored there and if lower replace it. That way you store only three values per key instead of three arrays.


In reply to Re: How to group by a column and calculate max/min on another by jethro
in thread How to group by a column and calculate max/min on another by perl_paduan

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.