Rick Perry is not the sharpest knife in the drawer. What would possess him to attack Donald Trump? What can be gained by this? What he's doing is alienating Trump's supporters and thereby ruining his (Perry's) own electoral prospects. Does he think that if he earns the Republican nomination, the people he alienated and insulted will vote for him? That's laughable. They'll stay home, as many did in 2012. Another thing Perry ignores is this. Suppose he earns the nomination. Trump may decide to run as a third-party candidate, which would ensure Perry's defeat. I don't see a single benefit, for Perry, of running Trump down. He's a moron.
Addendum: Why is Perry not attacking Barack Obama with the same vitriol? This is precisely what conservatives hate: a Republican who attacks other Republicans but won't say a word about Obama, who is a disgrace to the office of the president and who has done more harm to this country than all previous presidents combined.