Though my temptation was different, the saint provides an example I would have done well to remember (from the life of St. Benedict):
On a certain day being alone, the tempter was at hand: for a little black bird, commonly called a merle or an ousel, began to fly about his face, and that so near as the holy man, if he would, might have taken it with his hand: but after he had blessed himself with the sign of the cross, the bird flew away: and forthwith the holy man was assaulted with such a terrible temptation of the flesh, as he never felt the like in all his life.
A certain woman there was which some time he had seen, the memory of which the wicked spirit put into his mind, and by the representation of her so mightily inflamed with concupiscence the soul of God’s servant, which so increased that, almost overcome with pleasure, he was of mind to have forsaken the wilderness. But, suddenly assisted with God’s grace, he came to himself; and seeing many thick briers and nettle bushes to grow hard by, off he cast his apparel, and threw himself into the midst of them, and there wallowed so long that, when he rose up, all his flesh was pitifully torn. So, by the wounds of his body, he cured the wounds of his soul, in that he turned pleasure into pain, and by the outward burning of extreme smart, quenched that fire which, being nourished before with the fuel of carnal cogitations, inwardly burned in his soul: and by this means he overcame the sin, because he made a change of the fire.
From which time forward, as himself afterward reported to his disciples, he found all temptation of pleasure so subdued, that he never felt any such thing. Many after this began to abandon the world, and to become his scholars. For being now freed from the vice of temptation, worthily and with great reason is he made a master of virtue . . . .
from the second chapter of Bk II of St. Gregory the Great’s dialogues