Late runs saw Perera rescue his side from possible embarrassment.
Thisara Perera smashed an unbeaten 80 off 57 balls as Sri Lanka recovered from an embarrassing batting failure to post 180 all out in the rain-curtailed first one-day international against Bangladesh on Monday.
Rubel Hossain, Shakib Al Hasan and Arafat Sunny claimed two wickets each to leave Sri Lanka tottering on 67-8 in the 22nd over after the hosts won the toss and chose to field in the day-night match in Dhaka.
Perera and Sachithra Senanayake ensured Sri Lanka did not fall below 147, their lowest one-day total against Bangladesh, by adding 82 runs for the ninth wicket.
Perera, who helped Sri Lanka record last-ball wins over Bangladesh in two Twenty20 matches last week, hit six sixes and four boundaries in a superb rearguard action.
Senanayake made 30 as Sri Lanka put on 113 valuable runs for the last two wickets after the spectacular collapse by the top order.
The match was reduced to 43-overs-a side from the stipulated 50 due to a wet outfield at the Sher-e-Bangla stadium, which had been drenched by persistent rain over the last two days.
Seamer Rubel Hossain began Sri Lanka’s downfall by removing both openers, Tillakaratne Dilshan and Kusal Perera, off successive deliveries spread over his second and third overs.
Batting mainstay Kumar Sangakkara was caught at mid-off trying to loft seamer Al-Amin Hossain out of the ground to make it 43-3 in the 11th over.
It became 67-8 as Dinesh Chandimal and Kithuruwan Vithanage ran themselves out, while left-arm spinner Sunny bowled skipper Angelo Mathews and Nuwan Kulasekara.
The second and third matches will be played at the same venue on Thursday and Saturday.
Sri Lanka won both the preceding Test and Twenty20 series.
First-innings scoreboard in the first one-day international between Bangladesh and Sri Lanka at the Sher-e-Bangla stadium in Dhaka on Monday:
Sri Lanka Innings
K. Perera lbw b Rubel 20
T. Dilshan c Rahim b Rubel 3
K. Sangakkara c Sunny b Al-Amin 8
D. Chandimal run out 13
A. Priyanjan lbw b Shakib 6
A. Mathews b Sunny 3
K. Vithanage run out 7
N. Kulasekara b Sunny 0
T. Perera not out 80
S. Senanayake b Shakib 30
L. Malinga c Anamul b Gazi 0
Extras: (lb1, w9) 10
Total (all out, 40 overs) 180
Fall of wickets: 1-22 (Dilshan), 2-28 (K. Perera), 3-43 (Sangakkara), 4-52 (Priyanjan), 5-58 (Chandimal), 6-62 (Mathews), 7-64 (Kulasekara), 8-67 (Vithanage), 9-149 (Senanayake), 10-180 (Malinga)
Bowling: Al-Amin 8-1-34-1, Rubel 8-0-37-2 (w5), Shakib 7-0-29-2 (w1), Sunny 6-2-31-2 (w1), Gazi 7-0-22-1, Mahmudullah 4-0-26-0.
Umpires: Sharfuddoula Saikat (BAN) and Rod Tucker (AUS)
TV umpire: Anisur Rahman (BAN)
Match referee: David Boon (AUS)