There is a single iterator for each hash, shared by all each, keys, and values function calls in the program; it can be reset by reading all the elements from the hash, or by evaluating keys HASH or values HASH.So if at all unsure just do
before the while loop.keys %{$patterns{$gen}})
But, why does this not happen every time the subroutine is called -- just once in a while?Is it possible that you sometimes return from the subroutine from inside the while loop?
In reply to Re^2: trouble with each and a hash of hashes
by shenme
in thread trouble with each and a hash of hashes
by marcokuma
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |