Ben Win Lue has asked for the wisdom of the Perl Monks concerning the following question:
O wise ones,
I have a hash pointers to records as values. I need to iterate the records in a specific order that can't be obtained by sorting the keys. My first idea was:
-get the values of the hash
-store them in a list
-sort the list
-foreach the records
I have a hash pointers to records as values. I need to iterate the records in a specific order that can't be obtained by sorting the keys. My first idea was:
-get the values of the hash
-store them in a list
-sort the list
-foreach the records
Since the record-hash might become quite large, I would like to know if there is a way to sort the records in place or other ways to minimize copying-operations.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: sorting a hash
by jbrugger (Parson) on Mar 26, 2005 at 09:34 UTC | |
Re: sorting a hash
by tlm (Prior) on Mar 26, 2005 at 14:36 UTC | |
by BrowserUk (Patriarch) on Mar 26, 2005 at 14:51 UTC | |
by tlm (Prior) on Mar 26, 2005 at 15:06 UTC | |
by Ben Win Lue (Friar) on Mar 27, 2005 at 17:33 UTC | |
Re: sorting a hash
by sh1tn (Priest) on Mar 26, 2005 at 11:17 UTC | |
Re: sorting a hash
by gube (Parson) on Mar 26, 2005 at 12:08 UTC |
Back to
Seekers of Perl Wisdom