opendir(FILES,"$SAVE_DIRECTORY"); @allfiles = sort { (stat $a)[9] <=> (stat $b)[9] } (grep(!/^\.\.?$/,readdir(FILES))); closedir(FILES); foreach $file (@allfiles) { print "$file " . (stat $file)[9] . "\n"; } exit;