in reply to Get the latest file

Check out this node on how to parse the timestamps coming back from Net::FTP's dir() method.

With this tool under your belt, you'll probably come up with something like this:

use warnings; use strict; use Net::FTP; use File::Listing; use List::Util qw(reduce); my $ftp = Net::FTP->new('ftp.host.com'); $ftp->login('username', 'password'); my $latest = reduce { $b->[3] < $a->[3] ? $a : $b } File::Listing::parse_dir($ftp->dir()); print "Last modified file is: '$latest->[0]'\n";