in reply to Re^3: Is this the most elegant way to code directory lookup? (!unless)
in thread Is this the most elegant way to code directory lookup?

Or in this case,

next if -d || $_ eq "." || $_ eq "..";

or just

next if -d;