Perry had a goal and two assists, his first points with the Stars since signing a one-year contract as an unrestricted free agent July 1. He missed the first seven games of the season with a broken foot.
"It hasn't been easy. We've been in a lot of hockey games, but we've kind of kicked ourselves in the foot a few times," Perry said. "Tonight, we stuck with it, we found a way. ... We found a way to win. It doesn't matter if it's ugly."
[WATCH: All Stars vs. Flyers highlights]
Roope Hintz had a goal and an assist, and Ben Bishop made 38 saves for the Stars (2-7-1), who scored at least three goals in a game for the third time this season.
"I'm getting a great opportunity," Perry said. "I'm playing with some pretty great hockey players (Hintz and Jamie Benn), and hopefully things continue to roll. I'm expecting them to."
Sean Couturier scored, and Carter Hart made 12 saves for the Flyers (2-3-1), who lost their fourth straight game.
"If you look at the shots, they were probably 9-1, 10-1 (in Philadelphia's favor) at one point, then they had a push where they scored two goals," Couturier said. "But I guess we still had chances before that. We didn't score, and I thought the last two periods we controlled the play. We just couldn't score, and every chance they would get, they'd score. We have to stay focused for 60 minutes."
Video: DAL@PHI: Hintz dekes and puts home his own rebound
Couturier scored 43 seconds into the first period to make it 1-0 on a tic-tac-toe play with Claude Giroux and Travis Konecny.
Hintz tied the game 1-1 at 7:00 of the first. He took a pass from Benn, skated around defenseman Matt Niskanen, and beat Hart.
Esa Lindell tipped a pass from Denis Gurianov for a power-play goal to give Dallas a 2-1 lead at 13:48 of the first.
The Stars were 1-for-25 on the power play before the goal.
"That was a tough game in a tough building against a good team," Benn said. "... We got it done, Bishop played great. Two points is all we really wanted, we don't really care how we did it. We got these two points, and we're going to move on here."
The Flyers outshot the Stars 39-16 and out-attempted them 64-39.
"You look at the scoring chances and the shots, obviously we had quite a bit more than they did, and there's some things to like about that," said Philadelphia forward James van Riemsdyk, who had nine shots on goal. "... We're going to have to find a way to generate more goals because obviously, again, when you score one goal, you're not going to win too many games."
Perry scored with a backhand at 1:24 of the third period to make it 3-1.
"He was unreal," Stars coach Jim Montgomery said. "Three games in four nights, his first three games of the year. Very impressive by him. Skilled, poised. Adds character, a little snot to us, and obviously skill. … Flyers were sitting here waiting for us at home. ... Those guys dug in, give them credit."
Miro Heiskanen scored into an empty net with 1:55 remaining for the 4-1 final.
Video: DAL@PHI: Gurianov sets up Lindell's power-play goal
They said it
"It was a great team effort. I thought we earned that. I know we gave up a lot of shots, but according to our statistics that we personally keep, we only gave up three chances in the third. ... And of course [goalie Ben Bishop] was awesome." -- Stars coach Jim Montgomery
"It's frustrating. Certainly, it's tough right now. I'm obviously here to score goals, and it's not going in, so I've got to stick with it. You have to stay with it, and they're bound to go in if I keep getting chances like this." -- Flyers forward James van Riemsdyk, who has no goals in six games this season
Need to know
It was Perry's first three-point game since he had three assists for the Anaheim Ducks in a 6-5 shootout loss to the Edmonton Oilers on Feb. 25, 2018. ... Giroux, who had an assist on Couturier's goal, has 16 points (three goals, 13 assists) in 18 games against the Stars. ... The Stars went 1-for-2 on the power play and are 2-for-27 (7.4 percent) this season. ... The Flyers, who trailed 2-1 after the first period, have not had a lead entering the second period this season. ... Philadelphia has lost its past two games (6-3 at Oilers on Wednesday) despite outshooting its opponents by a combined 91-38.
Stars: Host the Ottawa Senators on Monday (8:30 p.m. ET; FS-SW, TSN5, RDS, NHL.TV)
Flyers: Host the Vegas Golden Knights on Monday (7 p.m. ET; NHLN, TVAS, NBCSP, ATTSN-RM, NHL.TV)
Video: Perry, Bishop power Stars to 4-1 win against Flyers