Pakistan 451 (Younus Khan 177, Perera 5-137) v
Sri Lanka 99-1 (Silva 38no, Sangakkara 36no)
First Test, Galle, day two
Younus Khan converted his unbeaten century overnight to 177 and there were also half-centuries from Abdur Rehman (50) and Sarfraz Ahmed (55) to add to Asad Shafiq, who made 75.
Off-spinner Perera took the last five wickets to fall, including Younus, Rehman and Sarfraz, while left-arm spinner Rangana Herath removed Shafiq as spin was Sri Lanka's most potent weapon on the day.
Perera finished with five for 137 and Herath three for 116 before Kaushal Silva (38 not out) and Kumar Sangakkara (36 not out) helped Sri Lanka recover from the early loss of Upul Tharanga for 19.
Pakistan resumed on 261 for four with Younus and Shafiq stretching their fifth-wicket partnership to 137 before Herath trapped Shafiq in front. The batsman had reached a long way forward and reviewed the decision but with no inside edge to save him, he was on his way.
Younus then joined forces with Sarfraz to put on 66 for the sixth wicket, which fell when Younus' 331-ball vigil came to an end as Perera began his excellent spell, beginning by having Younus, who played a loose shot, caught by Lahiru Thirimanne at short mid-wicket.
Sarfraz reached his second Test half-century but perished when he failed to get the better of Perera, trying to increase the pace of scoring, although it took a sharp catch by Angelo Mathews at silly mid-on to ensure the off-spinner won the battle.
Rehman made 50 in 61 balls but after Saeed Ajmal (12) was caught by Mahela Jayawardene off Perera, he was caught by Kumar Sangakkara.
And Perera completed his five-wicket haul when Junaid Khan (0) was also caught by Jayawardene, leaving Mohammad Talha unbeaten on nine at the other end.
Dhammika Prasad, who struck early on day one to reduce Sri Lanka to 59 for three, returned two for 81 as the only other player to take a wicket.
Junaid then struck with the fourth ball of the fifth over to have Tharanga trapped in front with a delivery that swung back in to the left-hander, who opted for a review but earned no reprieve.
Thereafter, from 24 for one, Sri Lanka were solid with Silva and Sangakkara - who survived a very close call against Ajmal when he appeared to be trapped in front - building a strong partnership and together they ensured the home side reached stumps 352 runs adrift.
© Cricket World 2014