opendir DIR, $dir or die $!; my @files = grep /^(?!\.$)(?!\.\.$)/, readdir DIR; closedir DIR; print "Verzeichnis leer!" if @files == 0;