Late 18th century. Probably from Older Scots pyrl to thrust or poke at + -y. In the compound pirlie pig the second element is pig adjective; in Older Scots pirrel pig occurs in the same sense; the compound thus probably originally alluded to poking or prodding coins out of a pot.