my @dirs = grep { not -d $_ . '/aaa' or not -d $_ . '/aaa/xxx' } ('d1', 'e1'); print "Fehlerhafte Verzeichnisse:\n"; print "$_\n" for @dirs;