in reply to Re: Grouping By A Column
in thread Grouping By A Column

Due to autovivification, you can half the number of lines in the snippet:
my ($col1, $col2, $col3) = generate_data(); $hash{$col1}[0] += $col2; $hash{$col1}[1] += $col3;
will do.