opendir (my $dh,$dir) || die "unable top open dir $dir $!"; my @files = grep(/\w+/,readdir($dh)); closedir ($dh);