Perez beat two former champions as the Caribbean nation enjoyed a one-two in the event, although few people seemed to be paying much attention.
The discus was held next to the high jump which hogged the limelight as Qatari Barshim Mutaz won the gold medal, sending the Khalifa stadium into raptures.
Perez, 28, produced a throw of 69.17 metres with her fifth attempt to overtake compatriot Denia Caballero, the world champion in 2015.
Double Olympic and world champion Sandra Perkovic, who has been struggling for form this season due to injury, took the bronze with 66.72.
The Croatian had won four the of last five global titles, claiming Olympic gold in 2012 and 2016 and the world title in 2013 and 2017 with only defeat to Caballero in 2015 interrupting the run.
Perez said she had been worried about an injury before the competition.
"I thought I would not be able to recover. This is my fourth world championship and I always arrived in top shape but always left without medals. It shows you should never give up. I persevered and earned my medal," she said.
Perkovic said she was looking forward to a break.
"Let's move on now the season is over," she said. "I need some vacation and, next year, I want to be back." (Reporting by Brian Homewood, editing by Ed Osmond)