On Wed, Jan 4, 2012 at 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; >>?
>
If it is such a major complaint, how might it go about getting changed? I'm
new, so forgive me if this is a faux pas, but it would appear that the
obvious solution would be to pull the autovivification module into core.
After all, the module addresses the OP's concern exactly, it does not break
normal autovivification, and it has a 100% pass rate.
So, what does it take to get something like this into core?
David
--
Sent via my carrier pigeon.
Thread Previous
|
Thread Next