use File::Spec::Functions qw/ no_upwards catfile catdir /; opendir my $dh, $path or die "$path: $!"; my @files = sort map { catfile($path,$_) } grep { ! -d catdir($path,$_) && /^[^.]/ } no_upwards readdir $dh; closedir $dh;