in reply to Understanding the Schwartzian transform.
In English, from right to left (bottom up, in this case): read list of file names in directory. Store each name in an array ref containing the filename, and its modification time. Take that new list, and sort it in descending order based on a custom sort sub that does a numerical compare on the 2nd element of the array ref (I.e., the modification time). Finally, take that now-sorted list of array refs and map each ref back to the filename by extracting the first element (remember arrays are 0-based). The result is stored in @sorted_names. Try breaking that up into its components and printing out the result of each step if you're still unsteady on the details. Hope this helps.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Understanding the Schwartzian transform.
by Anonymous Monk on Jul 22, 2013 at 06:59 UTC | |
by Laurent_R (Canon) on Jul 22, 2013 at 07:29 UTC | |
by Anonymous Monk on Jul 22, 2013 at 08:03 UTC | |
by Laurent_R (Canon) on Jul 22, 2013 at 15:54 UTC | |
by choroba (Cardinal) on Jul 22, 2013 at 16:05 UTC | |
|
In Section
Seekers of Perl Wisdom