in reply to Re: Using 'each' to get random (key, value) pair from hash returns "uninitialized value"
in thread Using 'each' to get random (key, value) pair from hash returns "uninitialized value"
One more follow-up
If I only remove elements from the cache using 'each' followed by 'delete' and if I do a delete before each add, it would seem that your analogy if taken literally would give a nice (for my purposes) circular array type behavior. I.e., once I have filled the cache, so that adds follow deletes, then each new add fills the seat left by the previous delete and the conductor won't get around to the new add until he goes around again.
Does this indeed describe the behavior?
Note: for my purposes this would be wonderful - combining the benefits of a circular array with that of a hash. Specifically, then 'each' would return the oldest entry (and hence likely most stale cache entry) for deletion, while the hash allows for random access of elements.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Using 'each' to get random (key, value) pair from hash returns "uninitialized value"
by jethro (Monsignor) on Jan 28, 2011 at 23:00 UTC | |
by johngg (Canon) on Jan 29, 2011 at 00:26 UTC | |
by jethro (Monsignor) on Jan 29, 2011 at 01:09 UTC | |
by johngg (Canon) on Jan 29, 2011 at 18:53 UTC | |
by puterboy (Scribe) on Jan 29, 2011 at 23:11 UTC | |
|
Re^3: Using 'each' to get random (key, value) pair from hash returns "uninitialized value"
by duelafn (Parson) on Jan 29, 2011 at 13:38 UTC |