Perez was released by the Diamondbacks on Thursday.
Perez was designated for assignment by the Diamondbacks on Monday.
The Diamondbacks selected Perez's contract from Double-A Amarillo on Wednesday.
Perez will retire from baseball after finishing out the 2022 season with Toros de Tijuana of the Mexican League.
Cleveland designated Perez for assignment Wednesday, Tom Withers of the Associated Press reports.
Perez signed a deal to return to Cleveland for a fourth season Thursday, Jon Heyman of MLB Network reports.
Perez struck out one in two-thirds of an inning without allowing a baserunner to earn the save in Sunday's 5-4 extra-inning win over the White Sox.
Perez's 2020 team option vested to $3 million after he made his 60th appearance of the season in Sunday's 10-1 win over the Phillies.
Perez earned the final out during the ninth to record his first save of the season in a 7-5 victory against the Twins on Sunday.
Perez retired one of the two batters he faced and was credited with a hold Tuesday in the Indians' 9-5 win.