I've looked at File::Recurse and File::Find, but they both don't seem to handle sub-directories as I'd like. What I'm looking for is a nested hash of the directory, its files and sub-directories. i.e.
%result = ('top' =>[ file1,
file2,
file3,
subdir1 => [sub_file1, sub_file2],
subdir2 => [sub_file3,
sub_subDIR =>[sub_sub_file1]],
etc... ]);
If the top directory is "home" and one of the subdirectories is 'user1', I would like be able to access the files as
$result{'home'}[0]
$result{'home'}{'user1'}[0]
$result{'home'}{'user1'}[1], etc
Originally posted as a Categorized Question.