How will we reconcile this Pasuk, which implies that immediately after Moshe's death they would pervert their ways, with the Pasuk in Shoftim, 2:7, which states that they served Hashem throughout the lifetime of Yehoshua?
Rashi: This teaches us that a person's Talmid is as dear to him as he is to himself. Consequently, as long as Yehoshua was alive it was as if Moshe himself was alive. 1
According to one opinion in the Midrash Rabah, "Acharei" means a long time afterwards. 2
See Ba'al ha'Turim.
Refer to Bereishis 15:1:1:1 and the note there. Rashi answers for the other opinion (refer to 31:29:1:1)
Why did Moshe see fit to tell Yisrael that he knew that they would pervert their ways ... ?
Seforno: So that they would not ascribe their punishment to chance but to their sinful ways, thereby inducing them to do Teshuvah. 1
Seforno: As in Yeshayah, 48:5.


