Chronologically, Perry trashed Trump, IIRC, and The Donald is just reciprocating.
And Perry acknowledged he provided the encouragement...perhaps Perry has reasons not stated for his resignation...
I don’t recall him trashing the President.