develooper Front page | perl.perl5.porters | Postings from January 2012

Re: [perl #47948] [documentation] Hash::Util::FieldHash

Thread Previous | Thread Next
From:
David Golden
Date:
January 12, 2012 18:38
Subject:
Re: [perl #47948] [documentation] Hash::Util::FieldHash
Message ID:
CAOeq1c9kS+hNtGRPeVS1F-v83CPVDo-kmBM-cwBp7boGiPHA1A@mail.gmail.com
On Thu, Jan 12, 2012 at 9:08 PM, Father Chrysostomos via RT
<perlbug-followup@perl.org> wrote:
> My question is: Why is it unsafe at all to create or delete things from
> a hash that is being iterated?

Here is the relevant MJD post, I think:
http://blog.plover.com/prog/perl/undefined.html#3

> There have been at least three fixes to the deletion code since 5.14.
> Could it have anything to do with those?

MJD looks like it was legacy Larry code that had the problem.

I think it's all to avoid requiring two passes.

Should it be (now or in the future) safe to delete arbitrary keys
during iteration, then the same would apply to inside-out object
destruction.

-- David

Thread Previous | 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