Try something like this:
scalar localtime((stat("$dir_name/$file"))[9]);
This will give the modified/created time of the file.
If you are failing to browse thru the directory, then here's the code.
print_dir ( "YOUR/DIRECTORY/PATH" );
sub print_dir {
my ($dir_name) = @_;
opendir ( my $dir_h , "$dir_name") or die "Unable to open dir :$dir
+_name: $!\n";
while ( my $file = readdir($dir_h) ) {
next if ( "$dir_name/$file" =~ /\/\.$/ or "$dir_name/$file" =~ /\
+/\.\.$/ );
if ( -d "$dir_name/$file" ) {
print_dir ( "$dir_name/$file" );
}
print "$dir_name/$file - "."\n";
}
}
It'll browse thru directories/sub-directories as well.