Psalm 139:1-5 O Lord, You have searched me and known me.2 You know when I sit down and when I rise up; You understand my thought from afar. 3 You scrutinize my path and my lying down, And are intimately acquainted with all my ways. 4 Even before there is a word on my tongue, Behold, O Lord, You know it all.
The closest parallel I can think of to illustrate "perfect hatred" is of how a mother responds to a criminal trying to hurt their child. The mother responds in a form of "perfect hatred" directed at the crime being attempted and the criminal's lack of remorse. We hate what criminals have become and what they do. Such expressions of wrath are right and provide the foundation for retributive justice in our law and criminal justice system. All such expressions are based upon God's justice and wrath against sin, which alone is completely just and completely pure.
Only God can perfectly distinguish between the person and the act, hating "what they are" while still holding out His redemptive purposes to the person themselves. God's goodness does not cancel out His justice, holiness and wrath against sin. If anything, such attributes highlight the fact that God is a good God.