(Proverbs 2:12): "To save you from the evil way" - if you have occupied yourself with the words of Torah, they are able to save you from the evil way. Why? Because they are like a double-edged sword, as it is said (Psalms 149:6): "and a double-edged sword in their hand." Rabbi Yehudah and Rabbi Nehemiah: Rabbi Yehudah says: "double-edged" (pifiyot) like a sword that consumes from its two sides; and Rabbi Nehemiah says: "double-edged" (pifiyot) means that they [the laws] are written on this side and on that side. And so it is with the Torah: laws before it and laws after it. Before it - from where? As it is said (Exodus 15:25): "There he set for him a statute and a judgment, and there he tested him." After it - from where? As it is written (Exodus 21:1): "And these are the judgments that you shall set before them." "From a man who speaks perversities" - this is the wicked Pharaoh. At the time when Moses would come in to him, he would speak with him in words of perversity. How so? When the decree [plague] would come upon him, he would say to Moses, "Go, remove the decree from upon me, and I will send out Israel." And Moses would seek mercy until he removed the decree; and once Pharaoh saw that it had ceased, he would reverse his ways and say (Exodus 5:2): "I do not know the LORD, and I also will not send out Israel." Therefore it is said "from a man who speaks perversities."
Torah The Double-Edged Sword Against Pharaoh's Double-Talk
Midrash Mishlei 2:7
(משלי ב יב): "להצילך מדרך רע" - אם עסקת בדברי תורה, יכולין הן להצילך מדרך רע, למה? שהן דומים לחרב פיפיות, שנאמר (תהלים קמט ו): "וחרב פיפיות בידם": רבי יהודה ורבי נחמיה: רבי יהודה אומר: פיפיות כחרב שהיא אוכלת משני צדדיה; ורבי נחמיה פיפיות שהם כתובים מזה ומזה. וכך היא תורה, דינין מלפניה ודינין מאחריה: מלפניה מנין - שנאמר (שמות טו כה): "שם שם לו חק ומשפט ושם נסהו", מלאחריה מנין - דכתיב (שמות כא א): "ואלה המשפטים אשר תשים לפניהם". "מאיש מדבר תהפוכות" - זה פרעה הרשע, בשעה שהיה משה נכנס אליו, היה מדבר עמו בדברי תהפוכות, הא כיצד? כשהיתה הגזירה באה עליו, היה אומר למשה 'לך הסר הגזירה מעליי ואני משלח את ישראל', והיה משה מבקש רחמים, עד שהיה מעביר הגזירה, וכיוון שראה פרעה שבטלה, היה מתהפך במידותיו, ואומר (שמות ה ב): "לא ידעתי את ה' וגם את ישראל לא אשלח", לכך נאמר "מאיש מדבר תהפוכות".