in reply to Perhaps
in thread Recursive directory scanning

Good thing you're just "thinking". It also matches ".\n" and "..\n", thanks to $'s little-understood feature of matching before the optional newline at the end of the string.

Perhaps you want

/\A\.{1,2}\z/

-- Randal L. Schwartz, Perl hacker