my @files = sort { -M $a <=> -M $b } <*.log>; my $newest = $files[-1]; print "$newest\n";