develooper Front page | perl.perl5.porters | Postings from March 2013

Re: Perlfunc for each(), keys(), values() has been changed

Thread Previous | Thread Next
From:
Eric Brine
Date:
March 29, 2013 21:06
Subject:
Re: Perlfunc for each(), keys(), values() has been changed
Message ID:
CALJW-qFFnb+Nbbu537W5Qy5BcwuqehNWx9ujC29vKtBR4udMyA@mail.gmail.com
On Fri, Mar 29, 2013 at 10:39 AM, demerphq <demerphq@gmail.com> wrote:

> Well it means that
>
> foreach my $key (keys %hash) {
>   delete $hash{$key};
> }
>
> will never change the iteration order.
>

So you can delete arbitrary keys without changing order?

On Fri, Mar 29, 2013 at 7:39 AM, demerphq <demerphq@gmail.com> wrote:

> Any insertion into the hash may change the order, as will any deletion


So you can't delete arbitrary keys without changing order?

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