in reply to Re^2: In-place sort with order assignment
in thread In-place sort with order assignment
In a more general sense: how to call a sub for each hash entry as the hash table is traversed.
If that can be done, then output all keys to a file (call a print routine for each entry). Call a system sort routine for that file. The Perl program may be paged out. Many files may be created and lots of memory may be consumed, but when that sort finishes, there is a file that is in hash key order and all the physical memory that system sort used is now free.
Perl program reads that big file (millions of lines) and assigns sequential numbers to each entry.
Why wouldn't that work?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: In-place sort with order assignment
by dasgar (Priest) on Sep 20, 2010 at 00:48 UTC | |
by Marshall (Canon) on Sep 20, 2010 at 03:46 UTC | |
by dasgar (Priest) on Sep 20, 2010 at 05:06 UTC | |
|
Re^4: In-place sort with order assignment
by BrowserUk (Patriarch) on Sep 20, 2010 at 07:53 UTC |