my @files1 = grep {/\w/} readdir(DIR1); my @files2 = grep {/\w/} readdir(DIR2);