On Thu, Nov 21, 2002 at 07:56:51AM -0500, Sturdevant-Contractor, Robert W wrote:
> Thanks, Jeff.
> Yes, index ... with all the special names avail I thought there might be one
>
> to identify the position of the element within an array.
> Bob
I might be imagining this, but I thought I remembered reading something that
said such a variable was being considered for Perl 6. In the mean time, if you
must have the array index, just do something like this:
my @array = qw(one two three four five);
for (0..$#array){
print "array index $_ is $array[$_]\n";
}
Which prints:
array index 0 is one
array index 1 is two
array index 2 is three
array index 3 is four
array index 4 is five
HTH,
--
Michael
[EMAIL PROTECTED]
http://www.jedimike.net/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]