Perez, making only his fifth start since joining from Deportivo La Coruna in August, struck twice from close range inside the opening 16 minutes.
He netted again two minutes after the break to become only the sixth Arsenal player to score a hat-tick in the competition.
Alex Iwobi made it 4-0 after 53 minutes and it could have been even better for Arsenal as Alexis Sanchez rattled the crossbar with a fizzing free kick.
The St Jakob-Park crowd finally had something to warm them on a cold night when substitute Seydou Doumbia flicked in a consolation after a skilful turn in the area.
Arsenal topped the group because PSG were surprisingly held 2-2 at home by Bulgarian side Ludogorets, who qualify for the Europa League at the expense of Basel.
Manchester City ended their group campaign with a 1-1 draw at home to Celtic, having recovered from an early blow inflicted by one of their own on-loan players.
Patrick Roberts, signed by City last year, gave Celtic a fourth-minute lead, but his excellent individual effort was swiftly cancelled out by Kelechi Iheanacho with the remainder of the encounter struggling to live up to its explosive start.
With City already confirmed in second place in Group C and safely into the knockout stages, the match was an opportunity for manager Pep Guardiola to ring the changes from the side that lost 3-1 at home to Chelsea in the Premier League on Saturday.
There was equally nothing riding on the outcome at the Etihad Stadium for bottom side Celtic, who produced a spirited display and were the better team for most of the first half.
Jose Callejon and Dries Mertens gave Napoli a 2-1 win at Benfica, although both teams went into the last 16 after rivals Besiktas suffered a thumping defeat against Dynamo Kiev.