Among the bowlers, Cummins' gain was Rabada's loss.
Perera's 153-run knock helped Sri Lanka achieve the unthinkable in Durban.
Dane van Niekerk has been ruled out from the remainder of the ODI series.
Here are all the major stats and numbers recorded during a thrilling Test match in Kingsmead,
Perera scored a 153 not out in 200 balls.
Du Plessis credited Perera after the loss but looked disappointed.
Perera and Vishwa Fernando put on 78 runs for the last wicket.
Embuldeniya picked up a five-wicket haul.
Rabada got him out in the very next ball.
The second day also saw Steyn achieving a personal milestone.