Re: "$#{$array} "
- From: japhy@xxxxxxxxxxxx (Jeff 'japhy' Pinyan)
- Date: Fri, 29 Jul 2005 07:53:09 -0400 (EDT)
On Jul 29, Vineet Pande said:
I don't not understand how the $#{$array_r} returns "highest" element as 4 and not 5???
$#arrayname returns the highest INDEX in the array -- that means it returns the location of the last element in the array. If your array has 10 elements, $#array returns 9, because $array[9] is the 10th element.
There is no variable that is magically the highest value in an array.
-- Jeff "japhy" Pinyan % How can we ever be the sold short or RPI Acacia Brother #734 % the cheated, we who for every service http://japhy.perlmonk.org/ % have long ago been overpaid? http://www.perlmonks.org/ % -- Meister Eckhart .
- References:
- "$#{$array} "
- From: Vineet Pande
- "$#{$array} "
- Prev by Date: RE: "$#{$array} "
- Next by Date: Re: defined on hash value does not work in my code :(
- Previous by thread: Re: "$#{$array} "
- Next by thread: RE: "$#{$array} "
- Index(es):