or download this
opendir FILES, $dirname or die "Can't open $dirname:$!\n";
chdir $dirname; #to make sure we're in the right directory!
...
foreach my $file ( sort { $files{$a} <=> $files{$b} } keys %files) {
printf("file %s was last modified %.2f days ago", $file, $files{$f
+ile});
}