As the other replies said, they start with [0].
for you #1 question, you can define the number of elements explicitly by doing
$#array = number. But I don't know if there is any maximum
=
use strict;
my @array=(1,2,3,4,5,6,7);
$#array=10;
my $nb=@array;
print "Number of elements in the ta
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
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 elem
1) I am not sure on the max size in perl I think it was alot ;)
2) to access the 5th element its print $item[4]; arrays start with 0 to
let you know.
On Mon, 2001-10-22 at 21:46, Brian wrote:
> #1 How can I tell the upper boundary limit of the array (IE, Max Entries)
>
> #2 if I have an array