in reply to What is "Schwarzian Transform" (aka Schwartzian)
And you want to sort them according to size. You would do it with ST like this:-r--r--r-- 1 yourname 8318 Jan 30 1996 file1.txt -r--r--r-- 1 yourname 11986 Jan 30 1996 file2.txt -r--r--r-- 1 yourname 46852 Feb 27 1996 file3.txt -r--r--r-- 1 yourname 72698 Feb 27 1996 file4.txt
So in principle you would do ST in the following step:@sorted_by_size = map { $_->[0] } sort { $a->[1] <=> $b->[1] } map { [$_, -s] } @files;
Check this out by the very creator himself - Randal Schwartz (merlyn).1. Map the initial list into a list of ref to lists with the original +and modified values 2. Sort the list of references 3. Map the list of ref back into a plain list with the initial values
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: What is "Schwartzian Transform"
by monarch (Priest) on Jul 21, 2005 at 07:51 UTC | |
by kelan (Deacon) on Jul 21, 2005 at 12:28 UTC | |
by merlyn (Sage) on Jul 21, 2005 at 15:56 UTC | |
|
Re^2: What is "Schwartzian Transform"
by GrandFather (Saint) on Jul 21, 2005 at 04:06 UTC | |
by tlm (Prior) on Jul 21, 2005 at 04:29 UTC | |
by GrandFather (Saint) on Jul 21, 2005 at 04:35 UTC |