123456789
if (-d $pfad) { opendir(D,$pfad) || die "opendir $pfad: $!"; my @dir_entries = readdir(D); if (scalar(@dir_entries) == 2) { print "leer"; }else{ print "nicht leer"; }}