- or download this
use strict;
use warnings;
...
last if !@dir_split;
$dir = $dir->subdir(shift(@dir_split));
}
- or download this
my $dir;
for ( file($path)->dir->dir_list() ) {
$dir = $dir ? $dir->subdir($_) : dir($_);
say $dir;
}
- or download this
my $dir;
my @paths = map { $dir = $dir ? $dir->subdir($_) : dir($_) }
file($path)->dir->dir_list();