Sayyiduna Anas (may Allah be pleased with him) says that a bedouin came to the door of the Prophet (peace and blessings be upon him), put his eye to a crack in the door and began peeping in, and the Prophet (peace and blessings be upon him) saw him. He (peace and blessings be upon him) took a pointed stick to strike the bedouin's eye, and he fled. Then he (peace and blessings be upon him) said: "Had he stayed where he was, I would have put out his eye."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الأشربة والحد فيها / 17654