Re: length of an array in a struct in an array of structs in a struct in an array of structs



Billy N. Patton wrote:
> Tuan Bui wrote:
> > Hello,
> >
> > So I have this complex data structure I've built for myself, and I'm
> > trying to get this snippet to work:
> >
> > $k <
> > scalar(@{@{@VisitArray[$i]->PSearchStructArray[$j]->ClickPathArray}})
> >
>
> Ths should do it.
> $l=scalar(@{$VisitArray[$i]->PSearchStructArray[$j]->ClickPathArray});

Just to be pedantic, the scalar keyword and its parentheses are no-ops
there. The assignment to a scalar variable already imposes scalar
context on the array.

Assuming the above does what you want,

$l = @{$VisitArray[$i]->PSearchStructArray[$j]->ClickPathArray};

should work just as well.

Paul Lalli

.



Relevant Pages