<?xml version="1.0" encoding="windows-1252"?>
<node id="630" title="How do I reset an each() operation part-way through?" created="1999-10-07 20:20:53" updated="2005-08-15 10:05:46">
<type id="834">
perlfaq nodetype</type>
<author id="519">
faq_monk</author>
<data>
<field name="doctext">


&lt;P&gt;
Using &lt;CODE&gt;keys %hash&lt;/CODE&gt; in scalar context returns the number of keys in the hash &lt;EM&gt;and&lt;/EM&gt; resets the iterator associated with the hash. You may need to do this if
you use &lt;U&gt;last&lt;/U&gt; to exit a loop early so that when you re-enter it, the hash iterator has
been reset.

&lt;P&gt;
</field>
</data>
</node>
