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

Re: [perl #107528] Autovivification should be ignored when testingfor existence

Thread Previous | Thread Next
From:
Reini Urban
Date:
January 4, 2012 14:28
Subject:
Re: [perl #107528] Autovivification should be ignored when testingfor existence
Message ID:
CAHiT=DGg3Se0SJ5sK5dUsY5LoNo1xMm-nfPcQxO_D+cbXmLfiA@mail.gmail.com
On Jan 4, 2012 3:08 PM, "Eric Brine" <ikegami@adaelis.com> wrote:
>
> On Wed, Jan 4, 2012 at 8:04 AM, Robert Colvin <perlbug-followup@perl.org>
wrote:
>>
>> When testing the existence of a subkey in a hash, autovivification will
create the top level key(s) which means subsequent tests against the top
level key(s)
>> will give the incorrect result.
>
>
> The operand of C<< exists $list{E}{sub} >> is evaluated before C<< exists
>> is called, so the dereference vivifies C<< $list{E} >> before C<< exists
>> is called.
>
>
> On Wed, Jan 4, 2012 at 11:47 AM, Zefram <zefram@fysh.org> wrote:
>>
>> It's too late to change the default Perl behaviour in this regard.
>
>
> It seems to be this is a major complaint among Perl's users. Do we want
to fix this under C<< use 5.xxx; >>?

Absolutely!

>
> - Eric
>


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