in reply to Get the last modified file from the UNC path

The easiest way is to use readdir together with stat and sort.

Something like this:

use 5.020; my $dir = '\\\\server\\share\\my\\path'; opendir my $dh, $dir or die "Can't opendir '$dir': $!"; my @files = map { "$dir\\$_" } # convert filenames to absolute filen +ames with UNC path grep { !/^\.\.?\z/ } # ignore "." and ".." readdir( $dh ); my %last_modified = map { $_ => -M $_ } # cache the last modified time @files; @files = sort { $last_modified{ $a } <=> $last_modified{ $b } } @files +; say $files[0];

Update: Ignore . and .. entries, spotted by Marshall