Directory Structures!

2001-01-12 Thread Andy Williams

Hi,

I'm having a mental block today, so my apologies in advance!!

I'm using File::Find to recursively get all the files from a directory
structure, then splitting each $File::Find::name into an array.
What I need to do is put this into a data structure like:
$dirstruct{"mydir"}-{dir1}-{dir2}-["A.A","B.B"]
$dirstruct{"mydir"}-{dir1}-{dir3}-{dir4}-["C.C","D.D"]
$dirstruct{"mydir"}-{dir4}-{dir5}-["E.E"]
The directory listing would be:
/dir1/dir2/A.A
/dir1/dir2/B.B
/dir1/dir3/dir4/C.C
/dir1/dir3/dir4/D.D
/dir4/dir5/E.E

I know I've done this before, but I'll be damned if I can find it or
remember how I did it.

Please Help!

TIA

Andy



"That's the metaphorical equivalent of flopping your wedding
tackle into a lion's mouth and flicking his love spuds with
a wet towel - total insanity"







Re: Directory Structures!

2001-01-12 Thread Shevek

Am I right, now I look again, in thinking this can't be done as it
requires that every value be simultaneously a list and a hash? Maybe if
you tied things.

On Wed, 10 Jan 2001, Andy Williams wrote:

 $dirstruct{"mydir"}-{dir1}-{dir2}-["A.A","B.B"]
 $dirstruct{"mydir"}-{dir1}-{dir3}-{dir4}-["C.C","D.D"]
 $dirstruct{"mydir"}-{dir4}-{dir5}-["E.E"]

--
Shevek
I am the Borg.
sub AUTOLOAD { ($s=$AUTOLOAD)=~s/.*:://; eval qq{ *$AUTOLOAD=$s
?sub {$s*{$s-1}} :sub {1}; }; goto $AUTOLOAD; } print {'4'};