MIAMI, Florida (Reuters) - The slumping Florida Marlins fired hitting coach John Mallee on Wednesday and handed Eduardo Perez the task of revitalizing their sputtering offense.

The Marlins (31-29) were in dire need of a shakeup after losing seven in a row and languishing in most of the key offensive categories.

"It's been very frustrating," Marlins President of Baseball Operations Larry Beinfest told the team's website (florida.marlins.mlb.com).

"I know the guys are frustrated. We're frustrated. We need to find a way to execute and score runs when we have that opportunity."

Mallee, who was given the job last June year, was shown the door with Florida hitting just .248 with a .321 on-base percentage.

Perez, 41, enjoyed a 13-year career that included time with six different teams. He is the son of baseball Hall of Famer Tony Perez, and was most recently working as a television analyst.

(Writing by Jahmal Corner in Los Angeles; Editing by Peter Rutherford)