What really happened (supported by news reports at the time) was that he was speaking to a Tea Party in Austin April 15, 2009, when someone in the crowd yelled "Secede!" He answered the remark this way, as reported at the time by the Houston Chronicle:
Texas is a unique place. When we came into the union in 1845, one of the issues was that we would be able to leave if we decided to do that,” Perry said. “My hope is that America and Washington in particular pays attention. We’ve got a great union. There’s absolutely no reason to dissolve it. But if Washington continues to thumb their nose at the American people, who knows what may come of that.”He suggested, in a thickly veiled way, that he could imagine a situation in which secession might become necessary, but he never supported the notion.
To one who does support secession from his state, Gov. Perry's remark sounded like an attempt to laugh the idea off.
Anyway, it is self-contradictory and politically suicidal for a U.S. Presidential candidate to favor the right of secession.
When states begin exiting from the Union, Washington will do everything it can to resist; but it may not have the support and the resources Lincoln had to quash it.
My impression of Gov. Perry is that he is trying to walk a tightrope between the paleoconservative and neoconservative wings of the Republican Party. If I were a betting man, I would wager that he is going to fall off.
Update Sept. 26: Brent Budowsky at The Hill submits a concurring opinion, observing that the race for the Republican Presidential nomination is not, and never has been, a "two man race." Rather, it is like "the Wild West."