in reply to iterating hash keys sorted by values - last key twice?
What exactly is the problem? What's the input giving this problem?
Duplicate names in the output are possible if you two names resolve to the same Windows path.