in reply to Can't use an undefined value as a HASH reference
It means that this part of that line: @{ $tree->{children} }[ 0 ], which is the first element of an array, pointed at by the value of the element of the hash, pointed to by $tree, and keyed by the string 'children'; is undefined -- ie. has not been set -- thus when the code tries to use that undefined value as a hash reference ->{label}, you get the error message.
All of which probably won't help you at all if you don't know Perl; even if you have some experience of other programming languages.
What you will need to determine is whether:
And the first part of making that determination would be to inspect the source data from which the tree is constructed, and work out whether the undefined value should be set or not.
If, it should, then the code that constructs the tree will need correcting; if it shouldn't, the the attempt to access the undefined value should be made conditional.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Can't use an undefined value as a HASH reference
by Anonymous Monk on Aug 25, 2015 at 16:06 UTC | |
by BrowserUk (Patriarch) on Aug 25, 2015 at 18:03 UTC | |
by Monk::Thomas (Friar) on Aug 26, 2015 at 10:50 UTC | |
by BrowserUk (Patriarch) on Aug 26, 2015 at 11:51 UTC | |
by Monk::Thomas (Friar) on Aug 26, 2015 at 14:12 UTC | |
|