0 Replies - 1440 Views - Last Post: 24 December 2009 - 02:18 PM

#1 chorny_cpan   User is offline

  • D.I.C Head
  • member icon

Reputation: 2
  • View blog
  • Posts: 52
  • Joined: 13-May 09

Sorting list of files by date of change, desc

Posted 24 December 2009 - 02:18 PM

Description: sort_files_by_date_desc(\@files); #Modifies first argument Sorts list of files by date of change, most recent ones first.
sub sort_files_by_date_desc {
  my $files = shift;
  @$files= #Schwartzian Transform
   map { $_->[0] }
   sort { $a->[1] <=> $b->[1] }
   map { [$_ => -M $_ ] }
   @$files;
}
#(c) Alexandr Ciornii


Is This A Good Question/Topic? 0
  • +

Page 1 of 1