in reply to Re^3: How do I traverse the files in descending order of modification using File::Find
in thread How do I traverse the files in descending order of modification using File::Find

almut:
I found a very neat way of doing it without modifying any of the existing code, yes I had to change the way I was calling the find.
Here I go..
find( {wanted=> \&wanted, preprocess => \&preprocess }, #Added this line thats it '.'); #Added this function as well sub preprocess { my %afiletimes; foreach(@_) { $afiletimes{$_} = -M $_ if -f ; } @_ = sort { $afiletimes{$b} <=> $afiletimes{$a} } keys %afiletimes; }
  • Comment on Re^4: How do I traverse the files in descending order of modification using File::Find
  • Download Code