From perldoc -f each we read:
There is a single iterator for each hash, shared by all each, keys, and values
each
keys
values
use the keys() function to reset the iterator. See the faq for more info