用PERL 读取文件的一一些属性
#!usr/local/bin/perl -w
use strict;
use warnings;
use Data:umper;
use Time:arseDate;
use Date::Format;
my $path="/unicom/uniload/lxz";
#my $DIR;
#my $file;
my $to_time;
my $to_file;
opendir(ML,$path);
while(my @counter=readdir(ML)){
closedir(ML);
foreach $to_file(@counter) {
chomp($to_file);
$to_time=(stat($to_file))[9];
#my $current=parsedate($to_time);
#$current=time2str('%Y-%m-%d %H:00:00',$current);
print $to_file," ",$to_time,"\n";
}
}
结果都看不懂.
. 1226375050
.. 1226382043
eri_sz_msc_dal.pl 1219822930
collect_step.pl 1219468347
rand_data.pl 1219913569
aa.pl 1220593908
read_file.pl 1219651593
aa.sh 1220953284
file_read 1219651265
bb.sh 1220675061
file_time.pl 1220693733
a.pl 1220674868
temp_time.txt 1220693546
read_file_time.pl 1226382087
请问:我本想获得文件的时间.但是结果好像看不懂,得怎么办?