use strict; use warnings; my $max = 0; my ( $time, $oldest ); opendir ( my $d, '.' ) || die "Can't get file list: $!\n"; my @file = readdir ( $d ); closedir ( $d ); foreach ( @file ) { next if /^\.{1,2}$/; $time = -M $_; if ( $time > $max ) { $max = $time; $oldest = $_; } } print "$oldest was modified $max days ago\n";