The Perl equivalent for this is C<$#myarray>.
Set the highest index in the array to the given number, equivalent to
Perl's C<$#array = $fill;>.
RJ
hello http://grep.cpan.me/?q=\%24%23\w%2B%20dist%3Aperl%20+dist=perl
trigger for I<container magics>, i.e. it will for C<%ENV> or C<%SIG>
but not for C<$#array>.
perl-5.22.0/pod/perldata.pod
$days{'Feb'} # the 'Feb' value from hash %days
$#days # the last index of array @days
The length of an array is a scalar value. You may find the length
of array @days by evaluating C<$#days>, as in B<csh>. However, this
isn't the length of the array; it's the subscript of the last elemen
which is a different value since there is ordinarily a 0th element.
Assigning to C<$#days> actually changes the length of the array.
Shortening an array this way destroys intervening values
hello http://search.cpan.org/grep?cpanid=RJBS&release=perl-5.22.0&string=\%24%23&i=1&n=1&C=0#pod/perldata.pod pod/perldata.pod
53: $#days # the last index of array @days
357:of array @days by evaluating C<$#days>, as in B<csh>. However, th
+is
360:Assigning to C<$#days> actually changes the length of the array.
364:X<$#> X<array, length>
373: $#whatever = -1;
382: scalar(@whatever) == $#whatever + 1;
|