use strict; opendir(DIR,".") or die("Can't open directory '$!'"); while (my $file = readdir(DIR)) { next if $file =~ /^\.{1,2}$/; print "$file\n"; } closedir(DIR);