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

Re: Hoplites: Watch for "each"

Thread Next
From:
Tim Bunce
Date:
November 3, 2003 14:06
Subject:
Re: Hoplites: Watch for "each"
Message ID:
20031103213522.GB87682@dansat.data-plan.com
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.

Tim.

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About