I have an object I defined with a method, childNodes(), which returns an array. When I do something like:
my @arr = obj->childNodes()
I can clearly see that it can properly return an array.
My problem is that when I try to use this method to set the attribute of another class object, Perl decides I just want the length of childNodes() rather than the full array. This is not at all what I want and ruins everything. The code I m using for this is:
$self->{ _arr } = obj->childNodes()
How can I make this set $self->{ _arr } to an array instead of just a scalar number?
提前感谢!