toolic meant this sentence by the way:
After each has returned all entries from the hash or array, the next call to each returns the empty list in list context and undef in scalar context. The next call following that one restarts iteration.
Think of a hash as a bus with lots of passenger seats and 'each' as a ticket controller who just walks from front to back and then calls "undef" to the driver when he reaches the back. If he evicted every passenger on the seats he came by and no passengers entered the bus or changed seats while he did that, the bus would be empty afterwards. But if lots of passengers got in and passengers in the bus changed seats while he did that he would call "undef" and the bus would still be filled with lots of passengers.
In reply to Re: Using 'each' to get random (key, value) pair from hash returns "uninitialized value"
by jethro
in thread Using 'each' to get random (key, value) pair from hash returns "uninitialized value"
by puterboy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |