Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Save the resultant of " hash sorted by values "

by Anonymous Monk
on Mar 23, 2011 at 17:53 UTC ( [id://895062]=note: print w/replies, xml ) Need Help??


in reply to Save the resultant of " hash sorted by values "

The whole idea of a hash structure is that you can find any key, randomly, very fast ... but the trade-off that you always pay, is that the keys occur in no particular order, and that the perceived order of keys can change at any time. You can, however, "sort keys" and capture the result in another array... just be aware that you are gobbling up memory in doing so, and if the hash is in fact a tied-hash (i.e. not a memory data structure at all) your approach would basically be scroo'd. Seriously consider using an SQL table, even an SQLite (therefore, single file) database. "Memory" is sometimes highly over-rated.
  • Comment on Re: Save the resultant of " hash sorted by values "

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://895062]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-04-24 03:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found