![]() |
|
Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: Answer: How do I find the size of an array?by DrHyde (Prior) |
on Feb 10, 2010 at 11:00 UTC ( [id://822393]=note: print w/replies, xml ) | Need Help?? |
$#array + 1 is wrong. $#array is the index of the last element in @array. It is *normally* one less than the number of elements in the array, but not always, as it assumes that array indices start at 0. If $[ is set then that is not necessarily the case.
In Section
Seekers of Perl Wisdom
|
|