On Thu, 10 Jan 2008, John J. Trammell wrote:

> On Jan 10, 2008 9:51 AM, Mike Miller <mbmiller at taxa.epi.umn.edu> wrote:
> [snip]

Is there a reason for pointing out that I wrote something and then 
removing *all* of it?  ;-)


> OK, I just had to see how awful this would be in Perl.  Not too awful:
>
> % perl -MFile::Find::Rule -MList::Util=min -le 'print min map -M,
> find->in(".")'
> 0.00752314814814815
>
> This is the number of days that have passed since the most recent file
> modification.  Other variations can be had by changing out "-M" (see perldoc
> -f -X) and min/max.  File::Find::Rule also permits conditional chaining.
> One problem with this is that File::Find::Rule isn't generally part of the
> Perl core.
>
> Here's a variant that prints the date of the most recent file:
>
> % perl -MFile::Find::Rule -MList::Util=max -le 'print scalar localtime(max
> map { (stat($_))[9] } find->in("."))'
> Thu Jan 10 12:18:42 2008


Nice.  I wonder how the various methods compare in speed.  With a lot of 
files they must all be pretty slow, so speed is important.

Mike