in reply to treating the filesystem structure as hash of hashes

You shouldn't bother either building a hash structure or using File::Find.

If you have a bunch of paths like /media/sdb2/folder1/directory/file.txt, it'll be far quicker to just interrogate the file system directly:

my $path = '/media/sdb2/folder1/directory/file.txt'; print $path, -e( $path ) ? ' exists' : " doesn't exist";

To build the hash structure will take one filesystem access for every path element in the tree, including all those that you don't look up later. Likewise using File::Find.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."