Syntactic Confectionery Delight | |
PerlMonks |
Re: How do I find the size of an array?by usless_blonde (Initiate) |
on Oct 14, 2003 at 12:53 UTC ( [id://299087]=note: print w/replies, xml ) | Need Help?? |
Just to be reaaly stupid. What does $#array mean? I can't do that as everything after the # is ignored! {QandAEditor note-- Summarizing a followup to this node: $#array is the index of the last element in @array. #, in this case, doesn't begin a comment. $#array is not necessarily equal to scalar @array - 1. Use @array in scalar context to determine the size of an array. Use $#array when determining the index number of the last element of @array. }
In Section
Seekers of Perl Wisdom
|
|