in reply to Dots appearing when opening a directory

You can use glob, which expands like a shell would and excludes all files/directories that start with .
for (glob('*')) { print "$_\n"; }
You can also use grep with regex match operating on readdir.
opendir(my $dh, '.') or die $!; for ( grep { !/^\.+$/ } readdir $dh ){ print "$_\n"; }
Change the regex to  grep { /^[\w\d]/ } if you want only things that begin with a word or digit.

Replies are listed 'Best First'.
Re^2: Dots appearing when opening a directory
by marinersk (Priest) on Mar 06, 2015 at 22:04 UTC

    On a Windows system, glob gave me huge fits of incorrect results in early versions of ActiveState Perl, leading me to write my filenames.pm. When CPAN modules came out, they got increasingly closer to the goal, but still kept missing the mark.

    In those days, I was unable to devote time to working on taking my lessons learned in the writing of my filenames.pm module and applying them to the various CPAN modules (a recurring theme for me during that era of my career, unfortunately), so I grew into habitual use of my own module.

    In retrospect, I wish I'd gotten more involved in CPAN modules instead of rolling my own all the time; I'd have a much better toolkit at my disposal now, and as an added benefit I'd probably be better and faster at installing CPAN modules on the rare occasion where I find one could save me some development time.

    Ah, the heady days of youth.