New American Standard Bible (NASB)
Genesis 38
24 Now it was about three months later that Judah was informed, "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!"
25 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 examine and see, whose signet ring and cords and staff are these?"
26 Judah recognized them, and said, "She is more righteous than I, inasmuch as I did not give her to my son Shelah." And he did not have relations with her again.
27 It came about at the time she was giving birth, that behold, there were twins in her womb.
28 Moreover, it took place 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."
29 But it came about as he drew back his hand, that behold, his brother came out. Then she said, "What a breach you have made for yourself!" So he was named Perez.
30 Afterward his brother came out who had the scarlet thread on his hand; and he was named Zerah.
Genesis 39
1 Now Joseph had been taken down to Egypt; and Potiphar, an Egyptian officer of Pharaoh, the captain of the bodyguard, bought him from the Ishmaelites, who had taken him down there.
2 The Lord was with Joseph, so he became a successful man. And he was in the house of his master, the Egyptian.
3 Now his master saw that the Lord was with him and how the Lord caused all that he did to prosper in his hand.
4 So Joseph found favor in his sight and became his personal servant; and he made him overseer over his house, and all that he owned he put in his charge.