#!/usr/bin/perl -w use strict; =head1 NAME latest =head1 DESCRIPTION Lists the contents of one or more directories, sorted from earliest to latest. =head2 AUTHOR Paul Jungwirth =head2 LAST MODIFIED $Date: 2006-05-03 07:51:59 -0400 (Wed, 03 May 2006) $ =head2 COPYRIGHT Copyright (c) 2006 Paul Jungwirth =cut use File::Find; use Data::Dumper; my @files; # Collect all the mtimes: find sub { my $n = $File::Find::name; # print Dumper stat($_); my $t = (stat($_))[9]; push @files, [$n, $t]; }, @ARGV; # print Dumper \@files; @files = sort by_mtime @files; for my $file (@files) { print show_date($file->[1]), "\t", $file->[0], "\n"; } sub show_date { # my @lt = localtime shift; return scalar localtime shift; } sub by_mtime { # print Dumper $a; return $a->[1] <=> $b->[1]; }