in reply to How to list files in dir with respect to time ?

You are probably looking at something like this:

#!/usr/bin/perl + use strict; use warnings; + + my $dir = '.'; + opendir DIR, $dir or die "Can't open '$dir' - $!\n"; + my @files = map { "$dir/$_"} grep !/^\..?$/, readdir DIR; + my @sort_files = sort { $a->[1] <=> $b->[1] } map { [ $_ , (stat($_))[9] ] } @files; + + foreach my $file ( @sort_files ) { print $file->[0],"\t",scalar localtime($file->[1]),"\n"; }

/J\