i have the below code to get the list of ftp file names and i need to collect that modified time and date of that file. how i can get that? below is the code i am using and i need to have the request at the end of code where i use comment "#HERE"
use strict;
use warnings;
use Net::FTP;
use Net::FTP::File;
use File::Find::Rule;
use Net::FTP::Throttle;
use File::Path;
use Mail::Sender;
use Win32::OLE;
use Cwd;
our $ftp_dest;
our $ftp_source;
our $ftp_remove;
my @ftp_folders;
my @ftp_files;
#To Create date on the prepress server
my $hostname_prepress = 'ftp.sample.com';
my $username_prepress = 'username';
my $password_prepress = 'pass';
my $dirname_prepress = '/Folder';
my $sourcedir='/Folder/';
&collect_details($hostname_prepress, $username_prepress, $password_pre
+press, $sourcedir);
sub collect_details
{
our ($ftphost_source, $ftpuser_source, $ftppass_source, $ftpdir_sour
+ce)= @_;
print("\nProcess Started... FTP server connected...\n");
$ftp_source = Net::FTP::Throttle->new($ftphost_source, MegabitsPerSe
+cond => 8);
$ftp_source->login($ftpuser_source, $ftppass_source);
$ftp_source->cwd($ftpdir_source) or die "Can't change directory ($f
+tpdir_source):" . $ftp_source->message;
my $pwd_source = $ftp_source->pwd;
#print "$pwd_source\n";
my @ftp_details = $ftp_source->ls($pwd_source);
foreach my $file (@ftp_details)
{
if ($ftp_source->isdir($file) eq "1")
{
push(@ftp_folders, "$pwd_source$file");
print "$pwd_source$file is directory\n";
}
# else
# {
# push(@ftp_files, "$pwd_source$file");
# print "$pwd_source$file is file\n";
# }
}
foreach my $file (@ftp_folders)
{
print "$file\n";
&collect_ftp_details($file);
}
$ftp_source->quit;
}
sub collect_ftp_details
{
my ($path)=@_;
$ftp_source->cwd($path) or die "Can't change directory ($path):" .
+$ftp_source->message;
my $pwd_path = $ftp_source->pwd;
my @ftp_temp = $ftp_source->ls($pwd_path);
print "@ftp_temp\n";
foreach my $file (@ftp_temp)
{
if ($ftp_source->isdir($file) eq "1")
{
push(@ftp_folders, "$pwd_path$file");
print "$pwd_path$file is directory\n";
}
else
{
# push(@ftp_files, "$pwd_path$file");
#HERE
print "$pwd_path$file is file\n";
}
}
}