in reply to Directory Recursion Disorder
Given that your directory structure is only 2 levels deep, there is no need for recursion. You can build your Hash of Arrays in one line.
my %dirs = map{ $_ => [ map{ m[.*/(.*?)$] } glob "$_/*" ] } grep{ -d } glob "/basedir/*";
The main advantage is that you build the datastructure you want directly, but I'm also not much of a fan of the Find::File* stuff.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Directory Recursion Disorder
by Anonymous Monk on Jun 24, 2003 at 04:14 UTC |