If you have 5.8.3 or later, it's more efficient to use keys %hash; in a void context rather than a scalar context if you only want to reset the iterator.
This avoids the need to calculate the number of keys in the hash, which for large and/or tied hashes can potentially be an expensive operation.
In reply to Re: Re: Why Doesn't each() DWIM?
by BrowserUk
in thread Why Doesn't each() DWIM?
by enoch
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |