Re: "$#{$array} "
- From: umesh.perl@xxxxxxxxx (Umesh T G)
- Date: Fri, 29 Jul 2005 16:01:02 +0530
Hi,
On 7/29/05, Vineet Pande <pande_vineet@xxxxxxxxxxx> wrote:
> I don't not understand how the $#{$array_r} returns "highest" element as 4
> and not 5???
>
> #!/usr/bin/perl
> use warnings;
> use strict;
> my @array = (1,2,3,4,5);
> my $array_r = \@array;
> print "the highest element is number $#{$array_r}\n";
Array elements starts counting from 0 .. n
So it is show the max as 4..
Cheers,
Umesh.
.
- References:
- "$#{$array} "
- From: Vineet Pande
- "$#{$array} "
- Prev by Date: "$#{$array} "
- Next by Date: RE: Read a single line in a file.
- Previous by thread: "$#{$array} "
- Next by thread: Re: "$#{$array} "
- Index(es):
Relevant Pages
|
|