in reply to Re^4: 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"
It did take a while, but I finally got it. The || creates boolean, i.e. scalar context. And each() in scalar context returns only the key and not the index.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Using 'each' to get random (key, value) pair from hash returns "uninitialized value"
by johngg (Canon) on Jan 29, 2011 at 18:53 UTC | |
by puterboy (Scribe) on Jan 29, 2011 at 23:11 UTC |