my @files2 = grep { $_ ne "file1" and $_ ne "file2" and -f "$dir2/$_" }map { lc }readdir(DIR2); my @files = map { lc; ( $_ ne "file1" and $_ ne "file2" and -f "$dir2/$_" ) ? $_ :() }readdir(DIR2);