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.
In reply to Re: Can't use an undefined value as a HASH reference
by BrowserUk
in thread Can't use an undefined value as a HASH reference
by Anonymous Monk
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |