Help for this page

Select Code to Download


  1. or download this
    my %stats;
    for (<*>) {
      my $mtime = (stat)[9];   ## for atime, use (stat)[8]
    ...
    }
    my $oldest = (sort { $a <=> $b } keys %stats)[0];
    print "oldest: ", (join ',', @{$stats{$oldest}}), "\n";
    
  2. or download this
    my ($timestamp, $files) = ~0;
    for (<*>) {
      my $mtime = (stat)[9];   ## for atime, use (stat)[8]
    ...
      }
    }
    print "oldest: ", (join ',', @{$files}), "\n";