They have debated on the same stage five times, but rarely have the contrasts between Mitt Romney and Rick Perry been more in evidence than during separate appearances here Friday night. It was Romney the careful technocrat versus Perry the unplugged preacher.

Their dueling appearances came in disparate forums. Romney held a well-attended town hall meeting, a traditional New Hampshire testing ground for candidates. Perry appeared at a dinner of social conservatives, a constituency that has played a small role in New Hampshire politics but is highly influential in other states.

At this point in the campaign, Perry has lost his standing as the principal challenger to Romney for the Republican nomination, eclipsed by Herman Cain and perhaps others. His early missteps as a candidate have left him with enormous obstacles to overcome, though if he has as much capacity to continue to raise money as he demonstrated initially, those resources will assist him in trying.

The Romney and Perry appearances came at the end of a difficult week for both. Romney was again accused of changing or hedging his positions on climate change and Ohio’s collective-bargaining referendum. The dust-ups played into a character vulnerability that caused him so much trouble four years ago and gives him little room this time for such miscues. Many Republicans still doubt his convictions.

Perry unveiled an economic plan last Tuesday but stepped on that message by wading unexpectedly into the issue of whether President Obama was born in the United States. By Friday, the Texas governor inexplicably suggested that such “birther” talk was being kept alive by people who were trying to distract attention from his economic message, apparently forgetting that it was he who refused to take the issue off the table when given the opportunity.

At his town-hall meeting, Romney appeared in casual pants and an open-collar shirt. He looked weary from nonstop debates, fundraising appearances and campaign events. His opening statement included stories about his father and Israeli Prime Minister Benjamin Netanyahu. His message bent heavily in the direction of the tea party, with much talk about government spending, regulation and the burdens of big government, rather than job creation.

The first question from the audience made reference to Obama and what the questioner described as Obama’s “Marxist and socialist beliefs.” Romney was asked to address the questioner’s concerns about the president’s ideology.

Mindful of the land mines ahead, Romney deftly steered clear of embracing such characterizations. Instead he turned to Ronald Reagan for inspiration. “He said, ‘It’s not that liberals are ignorant, it’s just that what they know is wrong,’ ” Romney said. “And I happen to think that the president’s philosophy and that of the people around him is extraordinarily misguided. I think they take their inspiration from those who believe government knows better than free people how to run our lives and how to build an economy.”

That wasn’t the only care Romney took in responding to a generally friendly audience that nonetheless directed some pointed questions at the candidate.

One such question came from a man who told Romney that “everything you said in your introduction was wonderful” but who questioned some of the details of the former Massachusetts governor’s priorities.

He noted that Romney is promising to dramatically reduce federal spending, but without cuts in defense spending, with the preservation of major entitlement programs and with no new taxes.

“I’m just not seeing how that adds up,” he said.

Romney didn’t make clear that it does add up. He said the country will save money on defense by ending the wars in Iraq and Afghanistan. On entitlements he said that Medicare and Medicaid “need to be reformed.” He said he would turn Medicaid into a block grant to the states at the same level of spending as last year, plus 1 percent, but gave no hints as to how he would change Medicare.

He said repealing Obama’s health-care law will save about a trillion dollars. On domestic spending, he said he would “take a whole host of programs” and eliminate them or combine them but offered few details. He said he would cut federal employment by 10 percent “immediately by attrition.”

On immigration, he said securing the border, which has defied presidents of both parties, could be done with relative ease and used the question to take a shot at Perry.

“Some problems are hard,” he said. “How to stop al-Qaeda and the jihadists from attacking us around the world. That’s hard. How to stop people coming into our nation illegally, that’s not so tough. Build a fence. Have enough people to patrol it and turn off the magnets that draw people here illegally, like giving them in-state tuition or letting them go to work in companies where people don’t have the information they need to know who’s legal or not.”

He ended with a question about the Occupy Wall Street protests and turned it into an attack on the president. Romney said he sympathized with those protesters who are out of work and can’t find jobs. He has less sympathy, he said, with those who have “less benevolent sentiments.”

The problem, he said, is Obama’s failure to reboot the economy and recalled that Obama had said long ago that if he couldn’t do that, he might be a one-term president. “We’re here to collect,” Romney said. “Hold him to his words.” With that, he was done.

An hour later, Perry took the stage at a downtown hotel ballroom in Manchester. He appeared to feel totally at home, more so than in many other settings during the campaign. He was loose and extremely animated, even playful.

He sprinkled words like “awesome” and “cool” into his opening remarks and he played off the New Hampshire state motto, “Live free or die.”

“I come from a state where they had this little place called the Alamo and they declared ‘victory or death,’ ” he said. “We’re kind of into those slogans. Live free or die. Victory or death. Bring it!”

He extolled the virtues of freedom, saying that single word sums up his presidential campaign. He promoted his new economic plan that includes a flat tax with a 20 percent income tax rate for individuals and, with a dramatic flourish, pulled a postcard-size paper from his pocket to illustrate how simple the filing form would be for most taxpayers.

He talked about his upbringing in rural Texas and the values that were instilled in him there. He highlighted his credentials as a strong opponent of abortion. “The bottom line is this, if you want to stop Washington’s many violations of the 10th Amendment, especially when it comes to the most basic principle of protecting life, then we must make President Obama a one-term president. We must!”

The audience gave him a standing ovation.

He talked about his energy policy and said he looked forward to the day he could “salute to the south” to Venezuelan President Hugo Chavez and declare that America would no longer be dependent on oil from that hostile nation. As the audience broke into applause, Perry added with a growl, “Or maybe I won’t salute him.”

Closing out his remarks, he said, “Let’s let America be America and again be the land of the free.”

The two performances, even accounting for different settings, could not have evoked more stylistic differences. In the space of three hours, New Hampshire saw the essence of these two Republican candidates. If the nomination battle comes down to a contest between Romney and Perry, their clash will reverberate across the party.