so here is how it is: pain in the exit area leads to avoidance of the stool. and more they stay harder try become. and harder they are more painful it will become.
and this is a vicious cycle.
i would suggest you to use more fibre in ur diet and if still persist try adding a good stool softener
after consulting your doctor.