
A man who has a seminal emission, be it during sexual relations or due to masturbation or a nocturnal emission, is impure and to become pure must immerse in a ritual bath. (In those days, they ate in a state of purity.) The Talmudic sages ask: what is the rule if the semen was not emitted by sexual stimulation, but was removed by means of a toothpick? What are the issues under debate? In the Torah it is written “And a seminal emission which comes out of him” (Leviticus 15:16). What does the phrase out of him mean? On one hand, one can interpret the Scriptures as strictly requiring the semen be emitted from the body itself. On the other hand, one could argue that the Scriptures only demand that the semen be emitted and that there is no significance to how it comes out, so even if it comes out by means of a toothpick the man would be impure. (The Halachic arbiters were divided on deciding this issue.)
(Babylonian Talmud, Tractate Niddah 22a)