in reply to Sorting a (very) large file
@lines = <INPUTFILE>; @lines = sort { (split($a, /\t/))[2] <=> (split($b, /\t/))[2] } @li +nes;
I believe the most recent Perls have a special in-place sort() optimization when you're sorting an array and assigning it back to itself. (UPDATE: Yup, it was added in v5.8.4)
-sam
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Sorting a (very) large file (better*2)
by tye (Sage) on Nov 30, 2007 at 20:05 UTC | |
by samtregar (Abbot) on Nov 30, 2007 at 20:13 UTC | |
by tye (Sage) on Nov 30, 2007 at 20:15 UTC | |
by samtregar (Abbot) on Nov 30, 2007 at 20:19 UTC | |
by samtregar (Abbot) on Nov 30, 2007 at 20:32 UTC | |
| |
by tye (Sage) on Nov 30, 2007 at 20:37 UTC | |
|