Help for this page

Select Code to Download


  1. or download this
    # Sorts files in $dir and sets $latest->{file} with newest file.
    my $latest = (sort {$b->{mtime} <=> $a->{mtime}}
    ...
    map {{mtime => -M $_, file => $_}}
    <$dir/*>)[-1];
    my $oldM = (stat $oldest->{file})[9];
    
  2. or download this
    my ($newM, $oldM) = (sort {-M $a <=> -M $b} <./*>)[0,-1];