in reply to Finding directories at a variable depth

See dir_list in Path::Class::Dir.
use Path::Class::Rule qw(); my $i = Path::Class::Rule->new->dir->iter; while (my $d = $i->()) { say $d if 3 == $d->dir_list; }