opendir (DIR, $path) or die "Unable to open $path: $!\n"; my @files = grep { !/^\.\.?$/ && !-d $_ } readdir (DIR); closedir (DIR);