Embattled PA attorney general resigns after perjury conviction