Hi, thanks for sharing your health concern with team HCM!
In the present case of painful perineal swelling or lump, if I were your consulting physician, I would just say you, 'not to worry much as this is a common condition!' Just avoid rubbing or hitting over it; and avoid hot/spicy foods!
As per your description, it is a benign harmless lesion like a sebaceous
cyst, some infected fistula or common papilloma like some fibroepithelial polyp but doesn't seem to be piles!
In any case this could not be cancer...
Take caution not to get injured there as this might invite infection and to lessen the pain you have to take seitz-bath with cetrimide or other antiseptic solution and cold/ice compression locally!
If you are still worried, please get examined by a surgeon or get some FNAC like cytological examination or revert back to us.
Hope you got your answer. Please feel free to write to us if any more queries.
Wishing you the best health!