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.
|
|---|