"I'm very happy to be here at such an historic club", he said in a statement on West Ham's website.
Perez was signed from Deportivo La Coruna for £17m in the summer of 2016 but failed to establish himself as a regular in the team.
Sanchez, who has over 80 caps for his country, spent past year on loan at Espanyol.
Elite Dota 2 Team Easily Beat by Advanced AI Bots
The opening to the tournament saw members of the audience facing off against OpenAI as a sort of benchmark of their prowess. It was, however, given five invulnerable couriers-though it was not allowed to scout nor tank creep waves with them.
The 32-year-old joins the Hammers on a two-year deal after spending the second half of last season on loan at La Liga side Espanyol.
West Ham have already spent big this summer, landing the likes of Felipe Anderson, Issa Diop and Andriy Yarmolenko - as well as bringing in former Arsenal midfielder Jack Wilshere on a free transfer. "I'm very motivated." Perez said.
"I wish you all the best for the future and I hope you can go on and achieve great things".
West Ham United have endured relegation battles in their last two Premier League campaigns but striker Javier Hernandez says he is dreaming of a top six finish this season.
Lucas is happy at Arsenal but he wants to play regularly and West Ham is an option for him. He scores goals, but can also create them and link well with the midfielders.