Perl pipelined commands follow the right-to-left direction of the assignment operator. So you kind of have to think backwards. It is the operation that is done closest to the equals sign that it done first.
Of course, it is so second nature to me now, that I rarely think about how "backwords" it might seem. However if you grep first and then sort, you're going to have a more compressed sort, and as the best sorts are semi-quadratic, reducing the amount of items you are going to sort makes a lot of sense.
As handles are closed when they go out of scope, you can just do this:
my @list
= sort {-M $b <=> -M $a}
grep { !/^\./ && -f "$_"}
<$dir/*>
;
As you are using a glob to do this, you don't need to open the directory handle. But if you were, you can do it like this:
my @list = sort ... grep ...
do { opendir( my $dh, $dir ) or die "Cannot open '$dir': $!";
readdir( $dh )
};