in reply to Question about alternative to File::Find

Interestingly I was trying to improve this fdupes in perl just now

You can define your hash out the sub

my %hash = (); sub wanted (blah blah; %hash = ...; blah blah);