in reply to Getting latest modified file in a directory
#!/usr/bin/perl use strict; # https://perlmonks.org/?node_id=11140328 use warnings; use List::AllUtils qw( max_by ); my $latest = max_by { (stat)[9] } glob 'tmp*'; # or your file list print "latest = $latest\n";
|
|---|