in reply to Re^2: Hash value interpolation
in thread Hash value interpolation
The use of each is that it's not a memory hog. When you loop over keys, Perl has somewhere built a list of all the keys in the hash. This is especially disastrous when the hash is tied to some huge data set.
The real problem with each is that every hash has only one iterator, and if you drop out of a loop that's walking the hash, the next loop that tries to walk that hash will start where the first left off.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Hash value interpolation
by ikegami (Patriarch) on Feb 16, 2009 at 21:47 UTC | |
|
Re^4: Hash value interpolation
by csarid (Sexton) on Feb 17, 2009 at 23:21 UTC | |
by ikegami (Patriarch) on Feb 18, 2009 at 01:29 UTC | |
by Anonymous Monk on Feb 18, 2009 at 22:24 UTC |