Bangladesh lost its third wicket after lunch break, what threatened instability for the Tigers in the final day of the second Test.
Shakib Al Hasan and Mominul Hoque are on the crease.
Imrul Kayas was trapped leg before in a delivery from Perera.
Tamim Iqbal and Shamsur Rahman had shown promise for a long and steady partnership after commencing the day's play in the morning hours.
Both batsmen attempted similar cover drives and instead ended up dragging onto their stumps. Perera and Vithanage claimed one wicket apiece.
Bangladesh will need to bat through the day for a draw against Sri Lanka in the second Test at Chittagong's Zahur Ahmed Stadium.