I remember hearing or seeing somewhere that a Rebbi who uses the Torah for a punsihment can make a student hate Torah. For example,a boy speaks in class ,then the Rebbi makes the boy write over a whole perek of chumash. The boy will come to hate the Torah. They held never give a student a punsihment which involves Torah. Which gadol (gedolim) said this idea?