Chris Carpenter was starting to think his career might be over. Instead, the St. Louis Cardinals pitcher hopes he's just looking at another lengthy interruption.

The 2005 NL Cy Young winner will undergo season-ending surgery later this month to repair a nerve issue in his shoulder that has sidelined him since spring training.

The 37-year-old Carpenter has been told the surgery to relieve compressed nerves in the shoulder could allow him to resume his career, although there are no guarantees. The procedure involves removing the first rib and connecting muscles, and cleaning out scar tissue.

"I want to pitch again, and this is the way for me to pitch again," Carpenter said Tuesday before the Cardinals played the Rockies.

Carpenter heard what he wanted to hear from the surgeon, Dr. Gregory Pearl of Dallas. He didn't ask the doctor to give him odds of success.

"I asked him one simple question. I'm 37 years old, I've had a nice career, is this worth getting this done?" Carpenter said.

"There's no question he believes I can come back and be as strong as ever."

Carpenter has dealt since 2008 with an injury called thoracic outlet syndrome that causes numbness to his arm, shoulder, neck and face in various degrees. He doesn't believe his heavy workload last year for the World Series champions plays a significant role in his inability to pitch through it this year.

"We've tried since spring training to get this going and every time I try to come back unfortunately it just doesn't allow me to do that," Carpenter said. "To be honest with you, I wish I thought about this surgery a while back.

"If we did it in March or April, I'd be close to coming back now."

Until recently, the Cardinals had been optimistic Carpenter would respond to therapy and be able to pitch after the All-Star break. Carpenter had a setback throwing in Kansas City June 22, experiencing weakness and numbness, but resumed throwing after meeting Pearl in Dallas last week.

He lasted one more session.

Strength did not return to the shoulder after throwing on Friday and another session was cancelled on Monday while the pitcher and team pondered the future. Now, the Cardinals are optimistic Carpenter will be ready for spring training.

The 2005 NL Cy Young winner is in the first year of a two-year, $21 million contract. He's well acquainted with the disabled list, totaling 21 1-3 innings in 2007 and '08 due to reconstructive elbow surgery and shoulder woes, and missing the 2004 postseason due to nerve issues in the shoulder.

When healthy, he's among the game's best. Carpenter was 21-5 in 2005, led the National League with a 2.24 ERA in 2009 and is 95-42 since 2004 — a winning percentage of .693 that leads the majors over that period.

He was 4-0 in the postseason last fall, beating the Rangers twice in the World Series.

Carpenter didn't throw for nearly three months after the injury flared up early in spring training. He resumed throwing last month.

"I'm past the 'woe is me part, the here we go again,'" Carpenter said. "I'm excited about the outcome I might get. We can get this taken care of and hopefully I can get back out there and be better than I have been in the past."

General manager John Mozeliak said recovery time is three to six months for what he described as a "relatively simple" operation. The surgery will be performed on July 19 in Dallas, fitting into Pearl's schedule given Carpenter won't be pitching for a while.

The list of pitchers who have resumed their careers after this surgery include Kenny Rogers, Matt Harrison and Kip Wells, the latter dealing with a vascular condition rather than a nerve condition.

"Guys do come back from this," Mozeliak said. "Pitchers do come back. He does want to pitch again, and this will give him the best opportunity."

The news provides clarity for the franchise a month ahead of the trade deadline for a team missing two members of the rotation. Left-hander Jaime Garcia has missed a month with a shoulder strain and on Tuesday resumed throwing, and the team projects a return in early to mid-August.

Mozeliak said he'd be open to picking up a starting pitcher, for short or long term. Lance Lynn is a surprise 10-game winner and an All-Star as the rotation replacement for Carpenter and rookie Joe Kelly, who started Tuesday night, was 1-0 with a 3.38 ERA in four starts subbing for Garcia.

There are innings load concerns with Lynn, a starter for the first time in the majors, and Adam Wainwright, a year removed from reconstructive elbow surgery.

"We're not guessing anymore," Mozeliak said. "Now, we know. If we can find a starter that would make the most sense for us."