my $dir = '.'; opendir my $dirh, $dir or die $!; my @files = grep{ -f $dir . '/' . $_ }readdir $dirh; closedir $dirh; # nach modification time sortiert # sogenannte Schwartz'sche Transformation my @sorted_files = map{ $_->[0] } sort{ $a->[1] <=> $b->[1] } map{ [$_, -M $dir . '/' . $_] }@files; print $_,"\n" for @sorted_files;