Etymology
Today it means: In a manner that is lively or high-spirited Full definition →
From pert + -ly.
Etymology from Wiktionary, CC BY-SA 4.0.