1) use an array (say presized to 12k) 2) when you've read in 12k elements 3) sort the array 4) and discard all but the highest 10 ( splice)
Then put it in a hash or whatever you need to do
In reply to Re: Limit the size of a hash (use an array)
by Anonymous Monk
in thread Limit the size of a hash
by Dr Manhattan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |