##
@val = sort map {-M $_} grep {...
####
@tmp1 = readdir LOGS;
# @tmp now contains the files listed in "."
@tmp2 = grep {/.*\.log/} @tmp1;
#@ tmp2 now contains files that contain ".log"
@tmp3 = map {-M $_} @tmp2;
#@tmp3 now contains what?
@val = sort @tmp3;
####
use strict; #you are using strict, aren't you? ;)
my @val = map { $_->[0] }
sort { $a->[1] <=> $b->[1] }
map { [$_, -M $_] }
grep { /\.log$/ }
readdir LOGS;