in reply to get the average of hash values?

Untested:
my %data; while (<DATA>) { next if /^ID/ || /^\s$/; my ($id, $value) = split /,/; $data{$id}[0] += $value; $data{$id}[1] ++; } my %avg; while (my ($id, $info) = each %data) { $avg{$id} = $$info[0] / $$info [1]; }

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.