in reply to Random hash element (low memory edition).
But you could use the recipe for printing a random line from a file to just iterate through the hash without knowing how many elements it has and select a random one.
Yes, as long as you don't change the hash, keys will return keys in the same order every time. values will return values in the corresponding order.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Random hash element (low memory edition).
by amarquis (Curate) on Jan 24, 2008 at 20:51 UTC | |
by Roy Johnson (Monsignor) on Jan 24, 2008 at 21:06 UTC |