my @files = grep{ $_ !~ /\.\.?$/ # filter . und .. and -f $dir.'/'.$_ # überprüfe, ob es eine datei ist }readdir(DIR);