while () { chomp; my $ID = (split /\t/)[2]; $occurrences{$ID} = 0; # initial count }