develooper Front page | perl.perl5.porters | Postings from May 2016

Re: [perl #128231] Perl confuses a tied hash and its element, sogenerating a wrong error message

Thread Previous
From:
Zefram
Date:
May 24, 2016 17:05
Subject:
Re: [perl #128231] Perl confuses a tied hash and its element, sogenerating a wrong error message
Message ID:
20160524170450.GD16984@fysh.org
via RT wrote:
>The value of $obj->{X} in the attached file is undef, it is not a blessed
>hash, it is not a tied hash. So the attempt to locate method STORE in
>wrong.

The attempt is to store an autovivified hash in $obj->{X}, within the
tied hash %$obj.  If you don't want that to happen, you shouldn't be
referring to $obj->{X}->{Y} where $obj->{X} isn't a hash.  Not a bug.

-zefram

Thread Previous


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