for my $penta (keys %totalProbability) { print "$totalProbability{$penta}, $totalCounts{$penta}, ...\n"; }