#!/usr/bin/perl use strict; use warnings; use File::Spec; my $dir = '/pfad/der/zu/durchsuchen/ist'; opendir DIR, $dir or die $!; while( my $entry = readdir DIR ){ my $path = File::Spec->catfile( $dir, $entry ); next unless -d $path; # chown-BEfehl } closedir DIR;