Re: length of an array in a struct in an array of structs in a struct in an array of structs
- From: "Paul Lalli" <mritty@xxxxxxxxx>
- Date: 28 Jul 2005 10:54:19 -0700
Tuan Bui wrote:
> I do know that
>
> scalar(@{@VisitArray[$i]->PSearchStructArray})
>
> will return the length of PSearchStructArray well enough though.
Perhaps I'm having a brain cramp here, but I can't especially see how
that could work. The arrow notation is used for either A)
dereferencing a hash or array reference to get at its elements or B)
calling a method of an object or class.
In other words, I can see that
$VisitArray[$i]->{PSearchStructArray}
might return the value of the hash referenced by $VisitArray[$i] at key
'PSearchStructArray', or
$VisitArray[$i]->PSearchStructArray()
might call a method of the object $VisitArray[$i], which could in turn
return a list of values.
I cannot, however, discern any way in which
$VisitArray[$i]->PSearchStructArray
could return "the length of PSearchStructArray".
Can you please enlighten me by showing the code that creates your
classes and objects?
(For why I replaced your '@' with '$' in each example, please see:
perldoc -q difference
)
Paul Lalli
.
- Follow-Ups:
- References:
- Prev by Date: Re: can't run perl commands from command line
- Next by Date: Re: can't run perl commands from command line
- 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):