# read the paths and stat each one while (defined ($_=<>)) { my $f; my @s; ( $f = $_ ) =~ s/\r?\n$//; next unless @s = stat($f); $t{$f}=$s[9]; } # Sort and write to stdout for $_ (sort {$t{$a} <=> $t{$b}} keys %t) { my $f = $_; my $d = POSIX::strftime("%F %T", localtime $t{$_}); if ($dospath) { $f = Filesys::CygwinPaths::win32path($f); } print $d, " ", $f, "\n"; }