opendir my $dirh, $path || return FAILED; my @dir_contents = readdir $dirh; @dir_contents = File::Spec->no_upwards(@dir_contents); foreach my $f (@dir_contents) { # be portable. my @dirs = File::Spec->splitdir($path); my $path = File::Spec->catfile(@dirs, $f); my $r = $self->walk($path); if ($r == PRUNE) { last; } elsif ($r != SUCCESS) { return $r; } } closedir $dirh;