Genesis.
Chapter 38.
And it came to pass at that time that Judah went down from his brethren, and came as far as to a certain man of Adullam, whose name was Hirah. 
And Judah saw there the daughter of a Canaanitish man, whose name was Shua; and he took her, and went in to her. 
And she conceived and bore a son, and called his name, Er. 
And she conceived and bore a son again; and called his name, Onan. 
And she again bore a son; and called his name, Shelah: and she was in Chezib when she bore them. 
And Judah took a wife for Er his firstborn, whose name was Tamar. 
And Er, the firstborn of Judah, was wicked before the Lord; and God killed him. 
And Judah said to Onan, Go in to thy brother’s wife, and marry her as her brother-in-law, and raise up seed to thy brother. 
And Onan, knowing that the seed should not be his—it came to pass when he went in to his brother’s wife, that he spilled it upon the ground, so that he should not give seed to his brother’s wife. 
And his doing this appeared evil before God; and he slew him also. 
And Judah said to Tamar, his daughter-in-law, Sit thou a widow in the house of thy father-in-law, until Shelah my son be grown; for he said, Lest he also die as his brethren; and Tamar departed, and sat in the house of her father. 
And the days were fulfilled, and Shua the wife of Judah died; and Judah, being comforted, went to them that sheared his sheep, himself and Hirah his shepherd the Adullamite, to Timnah. 
And it was told Tamar his daughter-in-law, saying, Behold, thy father-in-law goeth up to Timnah, to shear his sheep. 
And having taken off the garments of her widowhood from her, she put on a veil, and ornamented her face, and sat by the gates of Enaim, which is in the way to Timnah, for she saw that Shelah was grown; but he gave her not to him for a wife. 
And when Judah saw her, he thought her to be a harlot; for she covered her face, and he knew her not. 
And he went out of his way to her, and said to her, Let me come in to thee; for he knew not that she was his daughter-in-law; and she said, What wilt thou give me if thou shouldest come in to me? 
And he said, I will send thee a kid of the goats from my flock; and she said, Well, if thou wilt give me an earnest, until thou send it. 
And he said, What is the earnest that I shall give thee? and she said, Thy ring, and thy bracelet, and the staff in thy hand; and he gave them to her, and went in to her, and she conceived by him. 
And she arose and departed, and took her veil from off her, and put on the garments of her widowhood. 
And Judah sent the kid of the goats by the hand of his shepherd the Adullamite, to receive the pledge from the woman; and he found her not. 
And he asked the men of the place, Where is the harlot who was in Enaim by the wayside? and they said, There was no harlot here. 
And he returned to Judah, and said, I have not found her; and the men of the place say, There is no harlot here. 
And Judah said, Let her have them, but let us not be ridiculed; I sent this kid, but thou hast not found her. 
And it came to pass after three months, that it was told Judah, saying, Tamar thy daughter-in-law has grievously played the harlot, and behold she is with child by whoredom; and Judah said, Bring her out, and let her be burned. 
And as they were bringing her, she sent to her father-in-law, saying, I am with child by the man whose these things are; and she said, See whose is this ring and bracelet and staff. 
And Judah knew them, and said, Tamar is cleared rather than I, forasmuch as I gave her not to Shelah my son: and he knew her not again. 
And it came to pass when she was in labor, that she also had twins in her womb. 
And it came to pass as she was bringing forth, one thrust forth his hand, and the midwife having taken hold of it, bound upon his hand a scarlet thread, saying, This one shall come out first. 
And when he drew back his hand, then immediately came forth his brother; and she said, Why has the barrier been cut through because of thee? and she called his name, Perez. 
And after this came forth his brother, on whose hand was the scarlet thread; and she called his name, Zerah. 
