develooper Front page | perl.perl5.porters | Postings from November 2003

Re: Hoplites: Watch for "each"

Thread Next
Tim Bunce
November 3, 2003 14:06
Re: Hoplites: Watch for "each"
Message ID:
On Mon, Nov 03, 2003 at 05:06:01PM +0100, Elizabeth Mattijsen wrote:
> At 14:06 +0000 11/3/03, Tim Bunce wrote:
> >Its cheap to reset an iterator, just do
> >	keys %foo;
> >before the C<each> loop.
> Just wondering, is keys() optimized for void context?  Perlfunc only states:
>    As a side effect, calling keys() resets the HASH⤁s internal iterator...
> If it is _not_ optimized for void context, I think it's "easy" to 
> reset rather than "cheap"  ;-)
> If keys() _is_ optimized for void context, a change in the 
> perlfunc.pod seems to be in order.

No idea. A change in the perlfunc.pod seems to be in order either way.


Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About