Pérez pitched 7 2/3 scoreless innings, and the Red Sox headed into their first matchup against the New York Yankees with a 5-1 win over the Astros on Thursday.
"It was a fun game," Pérez said. "I enjoyed it and we got the win."
Christian Arroyo's first home run of the season, a three-run drive in the first inning, helped the Red Sox to the victory. His homer gave the Red Sox more runs than they'd managed in the previous two games combined in a series where the offense struggled mightily.
"It was an all-around good ballgame," Red Sox manager Alex Cora said. "For how bad it was the first three days, we can have a happy flight after this one."
Pérez (4-2) yielded six hits and struck out four in his longest start this season to win his fourth straight decision.
"Today he was on top of his game," Cora said. "He was amazing. He's been amazing the whole season. We're really happy with where he's at."
He had retired eight of the previous nine batters when Garrett Stubbs singled with one out in the eighth. He walked Aledmys Díaz with two outs, and Adam Ottavino retired Alex Bregman to end the inning.
Brandon Workman, signed to a minor league contract last month after he was released by the Chicago Cubs, was brought up from Triple-A Worcester and made his first Red Sox appearance since he was traded to Philadelphia last August. The 32-year-old right-hander, who pitched for Boston from 2013-14 and 2017-20, gave up Yuli Gurriel's eighth home with one out in the ninth.
Boston headed to Yankee Stadium in second place in the AL East, two games behind Tampa Bay and 2 1/2 games in front on the third-place Yankees.
Cora was happy to see his team get a couple of big hits on Thursday but knows the offense still needs to do more.
"It was better," he said. "It seems like we were able to slow down the at-bats today and you saw the results."
Houston starter Jake Odorizzi (0-3) labored through three innings in his second start after missing a month with a strained muscle in his right arm. He allowed three runs, four hits and three walks. Odorizzi's tough day ended a franchise-record streak of seven straight games in which Houston's starter had allowed just one run.
"It's just a bad-command start," Odorizzi said. "I wouldn't say my stuff was good at any point today."
Boston tacked on two runs in the seventh inning on a double by Xander Bogaerts that made it 5-0.
The Astros had outscored the Red Sox 18-4 in the first three games of this series but had trouble stringing hits together as their four-game winning streak was snapped.
Houston had a couple of chances to cut into the lead early but came up short both times. Díaz doubled with one out in the first, but he was caught trying to steal third with two outs to end the inning.
Astros: Reliever Kent Emanuel announced on social media Thursday that he would have season-ending surgery on his left ulnar collateral ligament. He has been on the injured list since May 26 with left elbow soreness. ... OF Michael Brantley (right hamstring tightness) is eligible to come off the injured list on Friday but it's unclear if he will. Brantley hasn't played since May 23.
"I didn't agree with the strike zone," Cora said. "I was arguing balls and strikes and you can't do that."