foreach $name (%$ref) {    bb:foreach my$dat (%{$ref->{$name}}) {      if ($dat eq "$datum") { foreach my$term (@{$ref->{$name}{$dat}}) {  printf "$tab %-10s: %-40s\n", $name, $term; } next bb;      }      my @dat = split ".",$dat;      if ($dat[0] =~ /^0/) { substr ($dat[0],0,1) = "";      } # # # # # # # # # # # # # # # # # # # # #      if ($dat[0] <= $max && $val == 1) { delete $ref->{$name}{$dat}; print "Geloescht!!\n";      } # # # # # # # # # # # # # # # # # # # # #    }  }