in reply to Re^4: Comparing files in directory
in thread Comparing files in directory

find does the search for you ( don't need for my $file ) and the current filename is in $_.

If find is within the sub, then yes you can declare your hashes there.

see File::Find for details.
poj

update : $_ is the filename only, if you have the same filename in subfolders then more code is required.