Genesis.
Chapter 38.
About that time, Judah left his brothers and settled near a man named Hirah, an Adullamite. 
There Judah saw the daughter of a Canaanite man named Shua, and he took her as a wife and slept with her. 
So she conceived and gave birth to a son, and Judah named him Er. 
Again she conceived and gave birth to a son, and she named him Onan. 
Then she gave birth to another son and named him Shelah; it was at Chezib that she gave birth to him. 
Now Judah acquired a wife for Er, his firstborn, and her name was Tamar. 
But Er, Judah’s firstborn, was wicked in the sight of the LORD; so the LORD put him to death. 
Then Judah said to Onan, “Sleep with your brother’s wife. Perform your duty as her brother-in-law and raise up offspring for your brother.” 
But Onan knew that the offspring would not belong to him; so whenever he would sleep with his brother’s wife, he would spill his seed on the ground so that he would not produce offspring for his brother. 
What he did was wicked in the sight of the LORD, so He put Onan to death as well. 
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, “He may die too, like his brothers.” So Tamar went to live in her father’s house. 
After a long time Judah’s wife, the daughter of Shua, died. When Judah had finished mourning, he and his friend Hirah the Adullamite went up to his sheepshearers at Timnah. 
When Tamar was told, “Your father-in-law is going up to Timnah to shear his sheep,” 
she removed her widow’s garments, covered her face with a veil to disguise herself, and sat at the entrance to Enaim, which is on the way to Timnah. For she saw that although Shelah had grown up, she had not been given to him as a wife. 
When Judah saw her, he thought she was a prostitute because she had covered her face. 
Not realizing that she was his daughter-in-law, he went over to her and said, “Come now, let me sleep with you.” “What will you give me for sleeping with you?” she inquired. 
“I will send you a young goat from my flock,” Judah answered. But she replied, “Only if you leave me something as a pledge until you send it.” 
“What pledge should I give you?” he asked. She answered, “Your seal and your cord, and the staff in your hand.” So he gave them to her and slept with her, and she became pregnant by him. 
Then Tamar got up and departed. And she removed her veil and put on her widow’s garments again. 
Now when Judah sent his friend Hirah the Adullamite with the young goat to collect the items he had left with the woman, he could not find her. 
He asked the men of that place, “Where is the shrine prostitute who was beside the road at Enaim?” “No shrine prostitute has been here,” they answered. 
So Hirah returned to Judah and said, “I could not find her, and furthermore, the men of that place said, ‘No shrine prostitute has been here.’” 
“Let her keep the items,” Judah replied. “Otherwise we will become a laughingstock. After all, I did send her this young goat, but you could not find her.” 
About three months later, Judah was told, “Your daughter-in-law Tamar has prostituted herself, and now she is pregnant.” “Bring her out!” Judah replied. “Let her be burned to death!” 
As she was being brought out, Tamar sent a message to her father-in-law: “I am pregnant by the man to whom these items belong.” And she added, “Please examine them. Whose seal and cord and staff are these?” 
Judah recognized the items and said, “She is more righteous than I, since I did not give her to my son Shelah.” And he did not have relations with her again. 
When the time came for Tamar to give birth, there were twins in her womb. 
And as she was giving birth, one of them put out his hand; so the midwife took a scarlet thread and tied it around his wrist. “This one came out first,” she announced. 
But when he pulled his hand back and his brother came out, she said, “You have broken out first!” So he was named Perez. 
Then his brother came out with the scarlet thread around his wrist, and he was named Zerah. 
