Oops..Sorry for the typo...Perl Arrays are 0 based arrays. So they start
with 0.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 22, 2001 5:33 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: Assistance with Array.


1) Perl Arrays are 0 based arrays. So they start with 1.
2) For array, @item, $#item will give you the last index. Therefore the
array's count number of elements can be obtained from $#item + 1
3) scalar(@item) will give you the total count number of elements.
4)@item[4] will give you the 5th element. But it is not an array element. It
is actually a slice with one element. Don't worry about the gory details.
You will get it fast with your learning curve. For now, do not use @item[4]
but use $item[4]. That is the right way to go.

-- Rex

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to