Sahih al-Bukhari, Book 79, Hadith 15 (In-Book) ⓘ
Narrated Sahl bin Sa`d: A man peeped through a round hole into the dwelling place of the Prophet, while the Prophet had a Midray (an iron comb) with which he was scratching his head. the Prophet said, " Had known you were looking (through the hole), I would have pierced your eye with it (i.e., the comb)." Verily! The order of taking permission to enter has been enjoined because of that sight, (that one should not look unlawfully at the state of others). (See Hadith No. 807, Vol. 7)
حَدَّثَنَا عَلِيُّ بْنُ عَبْدِ اللَّهِ، حَدَّثَنَا سُفْيَانُ، قَالَ الزُّهْرِيُّ حَفِظْتُهُ كَمَا أَنَّكَ هَا هُنَا عَنْ سَهْلِ بْنِ سَعْدٍ قَالَ اطَّلَعَ رَجُلٌ مِنْ جُحْرٍ فِي حُجَرِ النَّبِيِّ صلى الله عليه وسلم وَمَعَ النَّبِيِّ صلى الله عليه وسلم مِدْرًى يَحُكُّ بِهِ رَأْسَهُ فَقَالَ " لَوْ أَعْلَمُ أَنَّكَ تَنْظُرُ لَطَعَنْتُ بِهِ فِي عَيْنِكَ، إِنَّمَا جُعِلَ الاِسْتِئْذَانُ مِنْ أَجْلِ الْبَصَرِ " .
also referenced under: Hadith 6241 (DarusSalam) & Volume 8, Book 74, Hadith 258 (USC-MSA)