Malinga rattled Bangladesh with his fiery opening spell, reducing the visitors to 39-4 in the process, without allowing them to recover from the damage despite the best efforts by Mushfiqur Rahim and Sabbir Rahman.
Mushfiqur made 67 while Sabbir added 60 as the duo shared an 111-run partnership for the fifth wicket but Bangladesh stuttered to 223 all out in 41.4 overs replying to Sri Lanka's 314-8.
Retiring Malinga claimed 3-38 while Nuwan Pradeep (3-51) and Dhananjaya de Silva (2-49) played their parts in the win.
"I feel it's the right time for me to retire from ODIs. I have been playing for the last 15 years for Sri Lanka and this is the right time to move on," Malinga, who finished his ODI career with 338 wickets, said after the game.
"My time is over and I have to go."
Perera struck 111 off 99 balls with 17 fours and a six, his fifth ODI century, to set up Sri Lanka's total after skipper Dimuth Karunaratne won the toss and elected to bat first.
Left-handed Perera put on 97 runs with Karunaratne for the second wicket before adding 100 with Kusal Mendis for the third wicket.
Shafiul Islam, who finished with 3-62 in his first match in three years, drew the first blood for Bangladesh when he had opener Avishka Fernando caught by Soumya Sarkar at slip for seven.
Perera was reprieved on 49 runs when the third umpire overturned a caught behind decision off Shafiul.
Part-time seamer Soumya ended the valiant knock of Perera as he was caught at short fine leg by Mustafizur Rahman.
Mendis, who was dropped on 28 by Mahmudullah Riyad off Soumya, fell to Rubel Hossain the next over after making 43 off 49 balls.
Mendis walked after a muted appeal for caught behind from wicketkeeper Mushfiqur and bowler Rubel.
Angelo Mathews took Sri Lanka's total past the 300-run mark with 48 off 52 balls.
Mustafizur dismissed Mathews before finishing with 2-75.
Malinga, who was unbeaten on six with the bat, hit the leg-stump of opener Tamim Iqbal in his fifth ball with a deadly yorker.
Tamim, who debuted as Bangladesh's 14th ODI captain, was unable to open his account and the team's other top-order batsmen did hardly any better.
Pradeep trapped one-down Mohammad Mithun leg-before for 10 and Malinga bowled out opener Soumya for 15 in the next over.
Kumara compounded Bangladesh's problem once he removed Mahmudullah for three.
De Silva ended the resistance of Sabbir, forcing him to give a catch at deep midwicket to leave Sri Lanka's victory all but a formality.
Malinga took the final wicket fittingly to end the brief entertainment by Mustafizur, who made 18 off 14 balls before being caught by Thisara Perera at mid-off.
The second match will be held at the same ground on Sunday.