Hi, without examining its difficult to tell what it is. If there is pain and swelling it could be a perianal abscess. The other causes could be due to an external pile or anal tag. It could also be cysts, fungal infections, allergies, genital warts and infected hair follicles. If there is accompanying swelling, redness, discharge and fever it is most probably an infection. You may need to consult your primary care physician who will examine you and initiate appropriate therapy. Regards.