I don't understand from your text wether you want duplicate entries from file 1 (as you would get if you simply erased the names from file 2) or not (as you told in the last sentence).
If you want them your method is fine.
If you don't want them, simply add the names from file 1 to your hash when you encounter them the first time, so you would not take them again.