And Onan knew that the seed would not be his; and it happened that when he went in to his brother’s wife, he wasted it on the ground in order not to give seed to his brother.
Then Judah said to his daughter-in-law Tamar, “Live as a widow in your father’s house until my son Shelah grows up”; for he thought, “I am afraid lest he also die like his brothers.” So Tamar went and lived in her father’s house.
And after a considerable time, Shua’s daughter, the wife of Judah, died. Then Judah was comforted, and he went up to his sheepshearers at Timnah, he and his friend Hirah the Adullamite.
So she removed her widow’s garments from herself and covered herself with a veil and wrapped herself. And she sat at the entrance of Enaim, which is on the road to Timnah; for she saw that Shelah had grown up, and she had not been given to him as a wife.
So he turned aside to her by the road and said, “Here now, let me come in to you”; for he did not know that she was his daughter-in-law. And she said, “What will you give me, that you may come in to me?”
Then he said, “What pledge shall I give you?” And she said, “Your signet and your cord and your staff that is in your hand.” So he gave them to her and went in to her, and she conceived by him.
So he asked the men of her place, saying, “Where is the cult prostitute who was by the road at Enaim?” But they said, “There has been no cult prostitute here.”
Now it happened about three months later that it was told to Judah saying, “Your daughter-in-law Tamar has played the harlot, and behold, she is also with child by harlotry.” Then Judah said, “Bring her out and let her be burned!”
It was while she was being brought out that she sent to her father-in-law, saying, “I am with child by the man to whom these things belong.” And she said, “Please recognize this and see, whose signet ring and cords and staff are these?”
And it happened, while she was giving birth, one put out a hand, and the midwife took and tied a scarlet thread on his hand, saying, “This one came out first.”
And then it happened, as he drew back his hand, that behold, his brother came out. So she said, “What a breach you have made for yourself!” So he was named Perez.