develooper Front page | perl.perl5.porters | Postings from December 2017

Re: [perl #117449] GDBM tied hash weirdness; deletion ends 'each'loop

From:
Zefram
Date:
December 15, 2017 09:56
Subject:
Re: [perl #117449] GDBM tied hash weirdness; deletion ends 'each'loop
Message ID:
20171215095636.GB25404@fysh.org
This weirdness arises because deleting from a gdbm hash can reorganise
the hash.  Unlike Perl's own hashes, gdbm has no exception for deleting
the current entry.  This is explained at some length in the gdbm
documentation.  It is therefore impossible to make such deletion work as
desired, without making GDBM_File a far thicker layer over libgdbm than
it is clearly intended to be.  I have put a note about this issue in the
GDBM_File documention in commit 3752113a3158d060bec97da2512b1549afb5b4c7.

-zefram



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