use strict; my $newfile = "/perl/bin/newr"; opendir(DIR,$newfile); my @files = readdir(DIR); close(DIR); chdir ($newfile) or die "Could not change to $newfile directory\n$!\n"; for(@files) { my $filename = $_; my $accesstime = localtime ( (stat($filename))[8] ); # Doing a file stat on the special _ filehandle tells # Perl to use whatever happened to be in memory from the # previous stat rather than going out to the operating # system again (Llama: 3rd Ed., p.166) my $modtime = localtime ( (stat(_))[9] ); print "file name : $filename\n"; print "accs time : $accesstime\n"; print "mod time : $modtime\n"; }