-our $root = [ '.', [ ] ];
-# each node is [ 'relative subdir name', \@children ]
-
-sub build_tree () {
- foreach my $subdir (@ARGV) {
- my @path = $subdir eq '.' ? () : split m{/+}, $subdir;
- my $node = $root;
- foreach my $d (@path) {
- my ($c,) = grep { $_->[0] eq $d } @{ $node->[1] };
- if (!$c) {
- $c = [ $d, [ ] ];
- push @{ $node->[1] }, $c;
- }
- $node = $c;
- }
- }
-}
-
-