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"; } } }

In reply to How to get a ftp file date and time by Selvakumar

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.