find(\&matched, $suchpfad); chdir($suchpfad) || die "chdir: $!"; foreach (@delarray) { print "deleting $_\n"; rmdir("$_") || die "remove dir: $!"; }