> > Does there exist some way to protect before this problem (some kind of
> > auto-destructor, finally, whatever which would automatically rewind
> > the hash internal iterator while leaving the context)?
> 
> Not really a mod_perl problem, but you can read about the solution in
> the docs for each.
> 
>     There is a single iterator for each hash, shared by all "each",
>     "keys", and "values" function calls in the program; it can be reset
>     by reading all the elements from the hash, or by evaluating "keys
>     HASH" or "values HASH".

I found this note before asking, believe me... 
But it seems to me that this solution is not satisfactory - calling
'keys' or 'values' is inefficient and destroys most gains from
iterating over the hash using each...

-- 
( Marcin Kasperski   | Communication takes place between people, documents   )
( http://www.mk.w.pl |                are secondary. (Booch)                 )
(----------------------------------------------------------------------------)
( Porady dla twórców serwisów WWW: http://www.mk.w.pl/porady/porady_www      )

Reply via email to