my $path = "C:/some/path"; opendir( ORIG, $path ) or die "opendir failed on $path: $!"; my @filesInDir = grep { -f "$path/$_" } readdir( ORIG ); closedir ORIG;