my $dir = './leeres_verzeichnis'; opendir(DH, $dir) or die $!; my $count = () = readdir(DH); print $count > 2 ? "nicht leer\n" : "leer\n"; closedir(DH);