Perez shook off a season-long slump to allow four hits over 7 2/3 mostly dominating innings, outpitching Roy Oswalt and leading the Pirates to only their second home victory, 2-0 over the Houston Astros on Monday night.
Perez (1-2), taking his catcher's advice by mixing up his pitches more than before, didn't give up a hit until two outs in the sixth and struck out nine.
Oswalt (3-2) gave up two runs on sacrifice flies to end his three-game winning streak.
Perez developed into one of the NL's top starters at age 22 last season, going 12-10 with a 2.98 ERA and 239 strikeouts. But this season couldn't have gone much worse for the left-hander before Monday, as he was 0-2 with a 9.00 ERA and six homers allowed in 19 innings.
"But I forget everything tonight," Perez said. "I had to be focused, because this was an important game for us. We needed to win."
According to catcher Humberto Cota, Perez turned it around by changing his pitching pattern.
"He's been in the big leagues almost three years and the hitters are starting to know him, they know he's got that great slider," Cota said. "So he's pitching backward more -- when he sees them moving up in the box for the slider, he's throwing the fastball. He's doing the little things now, not just trying to overthrow the ball."
The Pirates had a major league-worst 1-6 home record but ended a four-game losing streak at PNC Park by dropping the Astros' road record to 1-9 -- also the worst in the majors. The Astros not only couldn't hit Perez consistently, but they also lost a possible run because of a fan interference call.
"Our rotten luck is a little worse than their rotten luck," manager Phil Garner said.
Craig Biggio doubled down the left field line with two outs in the eighth and a runner on first, but Raul Chavez was stopped at third when a fan touched the ball. Garner wasn't certain if Chavez might have scored on the play.
"You don't know what might happen -- we might get a run across that breaks the ice," Garner said. "You just don't know."
With the potential tying run at second and Perez tiring after throwing 121 pitches, Rick White came on to get Jeff Bagwell on a fly to right to end the threat. Jose Mesa pitched the ninth for his seventh save in as many opportunities.
Manager Lloyd McClendon predicted hours beforehand Perez was close to being back, and he was right.
"Nothing changed -- his velocity has been there -- he just threw strikes," McClendon said. "He kept himself under control ... he didn't get too hyped up."
Perez didn't allow a hit until Bagwell fought off a full-count pitch to single through the hole between first and second with two outs in the sixth. Houston didn't get a runner to second base until the eighth.
"He hit both sides of the plate, with both fastballs and sliders -- I think that was the key for him," Bagwell said. "At times he's almost effectively wild because you don't know exactly where to look for the ball."
"I slipped on the ball Bay hit to center," Oswalt said. "My landing foot slipped and it brought it back across the plate. That was the only pitch I was mad about all night."
The Pirates made it 2-0 in the seventh, even though Perez -- allowed to bat despite throwing 109 pitches to that point -- struck out with the bases loaded and none out.
Oswalt was lifted for a pinch-hitter in the eighth after allowing six hits, striking out six and walking two.
Jack Wilson was 0-for-24 until he singled twice. ... Pittsburgh has a major league-low 10 homers in 19 games after leading all NL clubs in spring training homers. ... Perez gave up 11 earned runs in 11 innings in his first two home starts. ... The Astros were 12-5 against the Pirates last season but were 3-4 in Pittsburgh. ... Mesa has saved every Pirates victory this season. He needs one more save to become the 19th with 300 saves. Six
active pitchers have 300. ... The Astros will bring up right-hander Ezequiel Astacio (0-3, 4.63 ERA at Triple-A Round Rock) to start Wednesday in place of Brandon Duckworth (0-1, 12.60 ERA).