in reply to Re: How to sort a large flat file 90mb with PERL-- various ways/tradeoffs/watchouts
in thread How to sort a large flat file 90mb with PERL-- various ways/tradeoffs/watchouts
Actually, you still have two arrays in memory. print for (sort @ary); creates a new array to hold the results of the sort, and can't throw out the value of @ary (until after the script ends), because the variable @ary is still in scope. @ary=sort @ary doesn't have this problem, in theory, but up to somewhen in the 5.8.x series (5.8.2, IIRC), it created a temporary array anyway.
In any case, yes, native sort is probably faster then perl sort for this.
|
---|