in reply to treating the filesystem structure as hash of hashes
Simply change
I threw out the 'sort', it has no use when you put things into a hash.foreach my $entry (@content){ $entry = lc $entry
Your data structure could be much simpler by using the complete path with filename as key. So that $filesystem{'/media/sdb2'}{'folder1'}{'directory'}{'file.txt'} would be stored in something like $filesystem{'folder1\\directory\\file.txt'} instead.
EDIT: a few edits because I misread the problem
|
|---|