in reply to Random hash element (low memory edition).
So why not just grab the first element of the hash? Or if you need more than one, grab the first N? Or you need a single random element from time to time, either maintain a counter and grab element $n++ using the methods discussed eaither in this thread, or if you can guarantee that the hash's iterator won't be used elsewhere, you can use 'each' to get the next element.
Dave.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Random hash element (low memory edition).
by moritz (Cardinal) on Jan 24, 2008 at 23:11 UTC | |
by dave_the_m (Monsignor) on Jan 26, 2008 at 17:42 UTC | |
|
Re^2: Random hash element (low memory edition).
by bart (Canon) on Jan 27, 2008 at 12:39 UTC |