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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |