Herath moved to ninth on the all-time wicket tally, with 423 career dismissals to his name, while Perera's five-wicket haul was the sixth of his career
South Africa collapsed dramatically against Sri lanka's spin to crash to 73 all out in the first Test in Galle on Saturday, their lowest total since readmission to international cricket.
The dismal performance came a day after they were bowled out for just 126, which had been their previous lowest Test innings in Sri Lanka.
Offspinner Dilruwan Perera took six for 32, and veteran left-arm spinner Rangana Herath claimed three for 32, as the pair bowled in an unbroken partnership for 28 overs, after Sri Lanka set South Africa a target of 352 for victory.
Herath moved to ninth on the all-time wicket tally, with 423 career dismissals to his name, while Perera's five-wicket haul was the sixth of his career.
South Africa's match aggregate of 199 was 20 runs fewer than Sri Lanka opener Dimuth Karunaratne's individual score across both innings.
Only three of the visitors made it into double figures, and the highest partnership yielded just 22, as batsmen repeatedly fell in their attempts to take on the Sri Lanka spinners.
South Africa's top scorer was Vernon Philander, who made 22 not out, with opener Aiden Markram batting out the most deliveries, facing 46 balls for his 19.
Dilruwan Perera and Rangana Herath sent South Africa crashing as Sri Lanka swept to a massive 278-run win on the third day of the first Test at Galle. #SLvSA— Sri Lanka Cricket (@OfficialSLC) July 14, 2018
SL 287 & 190
vs SA 126 & 73 all out (D Perera 6/32 , R Herath 3/38 )https://t.co/YutwB7VTp9 pic.twitter.com/rkGZ0LUtkw
Perera made the first breakthrough in the third over after lunch, having opener Dean Elgar stumped, after the batsman ran down the pitch and failed to connect with a turning delivery.
Hashim Amla was caught at leg slip for a duck in Perera's next over, and Temba Bavuma was caught for two by the same fielder shortly after, reducing South Africa to 24 for 3.
The wickets continued to tumble as Herath began to strike as well, with the next three batsmen out for 11 runs in the space of four overs.
It was not until left-arm spinner Keshav Maharaj joined Philander at the crease with the score on 36 for 6 that South Africa began to show any resistance, and even that partnership was snuffed out in 22 balls.
Left-arm wristspinner Lakshan Sandakan was required only to take the final wicket of the innings, while paceman and stand-in captain Suranga Lakmal did not bowl himself in this innings at all.
South Africa had begun the day 272 runs in arrears, but had bowled with discipline to remove the last six Sri Lanka wickets for 79 runs.
Kagiso Rabada had struck twice in an over in the first hour of the day, before spinners Maharaj, Tabraiz Shamsi, and Dale Steyn took one wicket apiece to finish the innings off.
REPORT: South Africa were skittled for 73 - their lowest total since readmission - as they collapsed to a 278-run defeat to Sri Lanka on day three of the first Test in Galle: https://t.co/NetIwJao5J #SLvSA pic.twitter.com/wehnEP0OW7— Sky Sports Cricket (@SkyCricket) July 14, 2018
Sri Lanka's second innings 190 was built on 35 from Angelo Mathews, and a stroke-filled 33 off 46 balls from Lakmal, who came in at No. 9.
South Africa were always going to struggle with a target of 352, but the rate at which they lost their wickets will be cause for serious concern ahead of the second Test in Colombo.
Sri Lanka's regular captain Dinesh Chandimal has been suspended for the series after he pleaded guilty to a breach of the spirit of cricket, over an incident that occurred in the West Indies last month.