The best way to determine the cause of pain and swelling near the anus is to examine the anus region. Swollen and painful piles appear at the edge of the anus while perianal abscesses and fistulae are found at least 1 cm away from the edge of the anus.
If your family doctor is unsure whether you have piles or abscess, he/she will usually refer you to a colorectal surgeon to confirm the diagnosis.