- or download this
opendir DIR, q{.} or die $!,$/;
my $last;
...
}
print $last; ## this prints the last file
closedir DIR;
- or download this
opendir DIR, q{.} or die $!,$/;
my @files = readdir DIR;
closedir DIR;
print $files[-1]; ## this prints the last file
- or download this
## sorted by name, case sensitive
my @files = sort {$a cmp $b} readdir DIR;