It seems I have a lot to say.
There's no sense in punishing yourself. We may do something at one time or other, then reflect on it, and say "wow. I was a dick. What a terrible person I am." and so on. Maybe something like that . At one point or another you have to let it go. Letting it go, is the only way to open past it. There's nothing wrong with recognizing it, but I would imagine it would be better to recognize how it arises in the first place.
A long time ago, maybe now, don't know. It was common practice for catholic priests to whip themselves. Mainly this was becasue the body was seen as "impure" and sinful. What a strange idea. I don't think we should be standing around whipping ourselves because we did something a moment ago. Eventually you have to let it go. You have to learn from it. You have to study it with both body and mind, and then drop it.
Let's say for example you get into an arguement with someone, and then you reflect on the arguement and fail to let it go. You know you shouldn't be holding onto it, and so you are basically fighting with yourself about what's right, and how one should act, and how you are a failure because you don't live up to your (insert ideal here). Let it go. Don't react, and drop it, and things should go smoother. Don't make a big deal. It's called being human. We are fallible from the get go, but I think we can learn to not care so much, not grasp at things, learn from our mistakes, and open past them. Each moment born anew.