Type of argument to keys on reference must be unblessed hashref or arrayref

♀尐吖头ヾ 提交于 2019-11-29 11:09:00

The new ability of keys to take a reference is broken by design. Perl's development team couldn't figure out how it should work with some references, so it only works for some references. As such, keys's ability to accept a reference is documented to be experimental. Unable to resolve this issue, this "feature" was removed 5.24. You shouldn't use it since your code will stop working when you upgrade your perl.

You've hit on of those case where keys doesn't work when given a reference. Provide a hash or an array instead. In this case, you probably want

keys(%{ $this->{'libraries'}->{$y}->{'cellHash'} })

The whole thing can be written as follows:

if (!keys(%{ $this->{libraries}{$y}{cellHash} })) { ... }

%{$this->{'libraries'}->{$y}->{'cellHash'}} .I missed the flower bracket and the % .

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!