in reply to perl group by and sort from a csv input file

Using Laurent_R's hash solution, combined with proper CSV parsing, I'd propose:

use Text::CSV_XS qw( csv ); my %acc; my $aoa = csv (in => "test.csv", on_in => sub { $acc{pack "L>L>", $_[1][0], $_[1][1]} += $_[1][2]; }); csv (in => [ map { [(unpack "L>L>", $_), $acc{$_}] } sort keys %acc ]) +;

Enjoy, Have FUN! H.Merijn