New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistent autovivification #15005
Comments
From hjp@hjp.atConsider the attached test script. It tries to use a non-existing node in a (deep) hash as an arrayref. First in the condition of a for loop: for my $node (@{ $cache->{$facttablename}{$parent_selection_key}{$relevant_roles}{path} Then in list context in an expression: ... The first one works (autovivifying ...->{path} to []), the second dies with the message Can't use an undefined value as an ARRAY reference at ./foo line 36 I don't see a meaningful difference between those two use cases. Either both should autovivify or both should die. |
From hjp@hjp.at |
From @iabynOn Fri, Oct 23, 2015 at 01:54:33AM -0700, Peter J. Holzer wrote:
Using a reduced version of your example: use strict; In the for loop, the array dereference is in lvalue context, since $node In the empty list assignment, the array derefernce is in rvalue context, It's basically the same as @{ $r->{foo} } = @a; # lvalue -- |
The RT System itself - Status changed from 'new' to 'open' |
@iabyn - Status changed from 'open' to 'rejected' |
Migrated from rt.perl.org#126432 (status was 'rejected')
Searchable as RT126432$
The text was updated successfully, but these errors were encountered: