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";
In reply to Re: Get the latest file
by saintmike
in thread Get the latest file
by skyler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |