Fun with Numbers
Yosef was in Mitzraim for 22 years. In this time period, Yehuda marries a girl named "bat shua." He has 3 children. The second one grows up and marries a girl named Tamar. After this a "long time" passes. Then Yehudah and Tamar have children. One of those children, Peretz, grows up and has children of his own. If we were to assume that pregnancy takes 9 months, that events happen immediately, that a "long time" is only 9 months or less, that Peretz's children were twins, and that people can have kids at the age of 10, this sequence of events would still take over 22 years. But, of course, those assumptions are ludicrous. The Talmud was sensitive to this point and suggests that indeed Yehudah's family gave birth at very young ages. Ibn Ezra suggests that the chapter 38 of genesis happened before chapter 37 [a tough sell in light of 38:1, and it doesn't necessarily solve the problem even if it's so]. But, these answers seem week. Of course, multiple authorship divides these stories in to different pieces so there's no problem. Cassuto has an interesting suggestion here: maybe Peretz'a sons were born in M'tzraim. It's a tough sell in light of all the explicit verses that say otherwise, but Cassuto has some fascinating argument to support himself, like, for example, the peculiar language of Gen 46:12 which differs from the rest of Gen 46. He argues that perhaps Peretz's sons, although born in Egypt, are included in the count to take the place of Er and Onan. An interesting theory, but contradicted by many verses.