Perez, the son of Hall of Famer Tony Perez, was an on-air analyst for "Baseball Tonight" on ESPN and "Béisbol Esta Noche" on ESPN Deportes. He will join the team Thursday.
The Marlins, led by manager Edwin Rodriguez, ranked 19th in runs scored, 17th in homers and 15th in team OPS before Wednesday's game. They suffered their seventh straight loss Wednesday to fall against the Atlanta Braves 3-2 in extra innings.
Perez has experience as manager in the Puerto Rico Baseball winter league. In the 2007-08 season he led Leones de Ponce to the title. He also won manager of the year, but Leones went 0-6 in the Caribbean Series that year in Mexicali, Mexico. Perez is also one of the main candidates for manager of Puerto Rico in the World Baseball Classic to be held in 2013.
Mallee was promoted to hitting coach in June 2010 after spending nine years as a minor league hitting instructor in the Marlins' farm system.
Left fielder Logan Morrison said Mallee was being made a scapegoat.
"I don't think it's right. I don't think it's just," Morrison said. "He had us prepared. It's not his fault we're not scoring runs. We let him down, and it's disappointing."
The Marlins' president for baseball operations, Larry Beinfest, said the decision to fire Mallee was made before the game. Nothing that happened subsequently changed his mind.
"I don't want to put it all on John, and I don't want to put it all on Eduardo," Beinfest said. "We just need to find a way to score some runs."
The losing streak is Florida's longest since April 2009. Six of the seven defeats have been by a single run.
"Every game we've been one hit away from winning," Rodriguez said. "What is missing is the execution from the players. They didn't go to the field and execute. It got to the point that maybe listening to a different voice or other approaches will make it happen."
Said Beinfest: "We need to stop this. We need to win some games."
Information from The Associated Press was used in this report.