If the mezuzah was hung on the doorpost in a rod, it is not a mitzvah and poses danger. Some say that the danger is being without the mezuzah protection, and some – that he may bang his head against it. However, the servants of the king Munbaz, who were always traveling, would put the mezuzah that way, to remind themselves of the commandment.
If one affixed the mezuzah to the doorpost like a bolt, that is, horizontally, it is invalid. That is the explanation of Rashi. Rabbeinu Tam, however, says that it would be unseemly for the mezuzah to be upright, since the Torah in the Ark was lying down, and he explains “like a bolt” as vertical, thus invalidating a vertical position. Tosafot say that the Talmud here alludes to three positions, one of them being like a letter L, and that this one is valid both according to Rashi and to Rabbeinu Tam.
The study hall of Rabbi Yehudah the Prince did not have a mezuzah. According to Rashi, it was another door, but the study hall does require a mezuzah; according to Tosafot, it does not, and the custom is to affix it without a blessing.
Art: Edouard Brandon - Rabbinical Students In A Classroom