Re: length of an array in a struct in an array of structs in a struct in an array of structs
- From: "Tuan Bui" <bigtrick@xxxxxxxxx>
- Date: 28 Jul 2005 12:54:50 -0700
Paul Lalli wrote:
> 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.
Yeah, I'm a perl newbie and I'm using the constructs the llama tells me
to use :)
>
> Assuming the above does what you want,
>
> $l = @{$VisitArray[$i]->PSearchStructArray[$j]->ClickPathArray};
>
> should work just as well.
If by "just as well" you mean "syntax error," then yes :) It's one of
the first things I tried.
I'm pursuing the intermediate-step path right now:
my @PSARef = @{$VisitArray[$i]->PSearchStructArray};
for(my $k = 0; $k < scalar(@{$PSARef[$j]->ClickPathArray}); $k++) {
but for some reason it's returning abnormal lengths that are invariant
with different iterations of the innermost loop.
>
> Paul Lalli
Back to the grind,
Tuan
.
- Follow-Ups:
- References:
- length of an array in a struct in an array of structs in a struct in an array of structs
- From: Tuan Bui
- Re: length of an array in a struct in an array of structs in a struct in an array of structs
- From: Billy N. Patton
- Re: length of an array in a struct in an array of structs in a struct in an array of structs
- From: Paul Lalli
- length of an array in a struct in an array of structs in a struct in an array of structs
- Prev by Date: Re: multidimensional insertion order
- Next by Date: Re: length of an array in a struct in an array of structs in a struct in an array of structs
- Previous by thread: Re: length of an array in a struct in an array of structs in a struct in an array of structs
- Next by thread: Re: length of an array in a struct in an array of structs in a struct in an array of structs
- Index(es):
Relevant Pages
|
|