in reply to selcting all files in a given directory except......

Instead of trying to match everything except those two names, match those two names and negate the test. Also, be sure to check for and report errors.

opendir my $dh, $dir or die "Can't opendir '$dir': $!"; my @files = grep { ! m{ \A \. \.? \z }xms } readdir $dh; closedir $dh or die "Can't closedir? $!";