The Mishnah Berurah (290:4) writes in the name of the Magen Avraham that one shouldn’t say on Shabbos “I am going to sleep, in order that I have strength to work on motzei Shabbos”. By doing so, he is showing that he is going to sleep in order that he has strength in the week, and one isn’t allowed to prepare on Shabbos for the week. The Sha’arei Teshuvah (s.k. 2) adds in the name of Eliyah Rabbah, that even if he does so for a mitzvah, i.e. so that he has strength to write chiddushei Torah after Shabbos, one should still avoid doing the above.
Based on the above, perhaps it should be forbidden for one to learn how to lein Megillah on Shabbos which is erev Purim. One who is doing so is clearly learning the Megillah for Purim, which is that night, therefore, perhaps we should say that there is a problem of hachonah [preparation]?
However, R’ Shlomah Zalman Auerbach (Shemiras Shabbos Kehilchosoh, Perek 28, he’orah 178) rules that it’s ok, because: כי ידיעתו כבר מעכשיו – “knowing how to this, is beneficial now as well”.
Seemingly we can bring proof to the above from siman 429, where we find that a talmid chocham gives a special Shabbos HaGadol drosha on Shabbos, even though the main focus of the drosha is to teach some halachos relevant to Pesach, which has nothing to do with Shabbos. Surely doing so should be hachonah? It must be, since one gains from knowing the halachos already on Shabbos itself there is no problem of hachonah.
For this reason, children are allowed to prepare for a test on their learning on Shabbos, even if the test is only after Shabbos, as they gain already on Shabbos from the learning.
Therefore, although one learning how to lein Megillah on Shabbos is clearly doing it for Purim, since he gains already on Shabbos from the learning, it seems that there is no issue of hachonah.
