for my $i (1..$numberOfBestFrags) { print "for loop nr. $i \n"; my $nrOfKeys = scalar keys %fragmentResultSetH; print "nr of keys = $nrOfKeys \n"; my $nrOfvalues = scalar values %fragmentResultSetH; print "nr of values = $nrOfvalues \n"; ....rest vom code wie oben........ }