The Diamondbacks received Low Single-A left-hander Junior Garcia in return.
The soon-to-be 34-year-old Perez will serve as the second southpaw out of Houston's bullpen, along with Tony Sipp.
As a whole, the bullpen has been a strength for the Astros, as their 2.70 ERA is second in the American League and third in baseball overall. They have a 3.0 fWAR, which is eighth in the Majors.
The Astros continue to show that they are ready to contend this season, acquiring Carlos Gomez, Scott Kazmir, and now Perez over the past few weeks to bolster their team with proven veterans down the stretch to hopefully bring them to the playoffs.
On the season, the impending free agent Perez is 2-1 with a 3.10 ERA (2.99 FIP) and 11.5 K/9 and 3.4 BB/9 ratios in 29 innings pitched on the season.