About this time, Judah left home and moved to Adullam, where he visited a man named Hirah.
There he met a Canaanite woman, the daughter of Shua, and he married her.
She became pregnant and had a son, and Judah named the boy Er.
Then Judah's wife had another son, and she named him Onan.
And when she had a third son, she named him Shelah. At the time of Shelah's birth, they were living at Kezib.
When his oldest son, Er, grew up, Judah arranged his marriage to a young woman named Tamar.
But Er was a wicked man in the LORD's sight, so the LORD took his life.
Then Judah said to Er's brother Onan, "You must marry Tamar, as our law requires of the brother of a man who has died. Her first son from you will be your brother's heir."
But Onan was not willing to have a child who would not be his own heir. So whenever he had intercourse with Tamar, he spilled the semen on the ground to keep her from having a baby who would belong to his brother.
But the LORD considered it a wicked thing for Onan to deny a child to his dead brother. So the LORD took Onan's life, too.
Then Judah told Tamar, his daughter-in-law, not to marry again at that time but to return to her parents' home. She was to remain a widow until his youngest son, Shelah, was old enough to marry her. (But Judah didn't really intend to do this because he was afraid Shelah would also die, like his two brothers.) So Tamar went home to her parents.
In the course of time Judah's wife died. After the time of mourning was over, Judah and his friend Hirah the Adullamite went to Timnah to supervise the shearing of his sheep.
Someone told Tamar that her father-in-law had left for the sheep-shearing at Timnah.
Tamar was aware that Shelah had grown up, but they had not called her to come and marry him. So she changed out of her widow's clothing and covered herself with a veil to disguise herself. Then she sat beside the road at the entrance to the village of Enaim, which is on the way to Timnah.
Judah noticed her as he went by and thought she was a prostitute, since her face was veiled.
So he stopped and propositioned her to sleep with him, not realizing that she was his own daughter-in-law. "How much will you pay me?" Tamar asked.
"I'll send you a young goat from my flock," Judah promised. "What pledge will you give me so I can be sure you will send it?" she asked.
"Well, what do you want?" he inquired.She replied, "I want your identification seal, your cord, and the walking stick you are carrying." So Judah gave these items to her. She then let him sleep with her, and she became pregnant.
Afterward she went home, took off her veil, and put on her widow's clothing as usual.
Judah asked his friend Hirah the Adullamite to take the young goat back to her and to pick up the pledges he had given her, but Hirah couldn't find her.
So he asked the men who lived there, "Where can I find the prostitute who was sitting beside the road at the entrance to the village?" "We've never had a prostitute here," they replied.
References for Genesis 38:21
So Hirah returned to Judah and told him that he couldn't find her anywhere and that the men of the village had claimed they didn't have a prostitute there.
"Then let her keep the pledges!" Judah exclaimed. "We tried our best to send her the goat. We'd be the laughingstock of the village if we went back again."
About three months later, word reached Judah that Tamar, his daughter-in-law, was pregnant as a result of prostitution. "Bring her out and burn her!" Judah shouted.
But as they were taking her out to kill her, she sent this message to her father-in-law: "The man who owns this identification seal and walking stick is the father of my child. Do you recognize them?"
Judah admitted that they were his and said, "She is more in the right than I am, because I didn't keep my promise to let her marry my son Shelah." But Judah never slept with Tamar again.
In due season the time of Tamar's delivery arrived, and she had twin sons.
As they were being born, one of them reached out his hand, and the midwife tied a scarlet thread around the wrist of the child who appeared first, saying, "This one came out first."
But then he drew back his hand, and the other baby was actually the first to be born. "What!" the midwife exclaimed. "How did you break out first?" And ever after, he was called Perez.
References for Genesis 38:29
Then the baby with the scarlet thread on his wrist was born, and he was named Zerah.
References for Genesis 38:30