summaryrefslogtreecommitdiff
path: root/av.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2020-08-28 21:18:41 -0600
committerKarl Williamson <khw@cpan.org>2020-09-13 21:13:58 -0600
commita56541ebc9ed6b2a0b96118b9e7fa5d769cb2762 (patch)
tree9a6027ce927d2a878c6f780307f018de4ab3b200 /av.c
parente572b3be45c78860f5e245874dc47d4ba6fe9cce (diff)
downloadperl-a56541ebc9ed6b2a0b96118b9e7fa5d769cb2762.tar.gz
Document AvFILLp; clarify related entries
Diffstat (limited to 'av.c')
-rw-r--r--av.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/av.c b/av.c
index 6fc129471a..ada09cde9a 100644
--- a/av.c
+++ b/av.c
@@ -802,19 +802,24 @@ Perl_av_shift(pTHX_ AV *av)
}
/*
-=for apidoc av_top_index
+=for apidoc av_tindex
+=for apidoc_item av_top_index
-Returns the highest index in the array. The number of elements in the
-array is S<C<av_top_index(av) + 1>>. Returns -1 if the array is empty.
+These behave identically.
+If the array C<av> is empty, these return -1; otherwise they return the maximum
+value of the indices of all the array elements which are currently defined in
+C<av>.
-The Perl equivalent for this is C<$#myarray>.
+They process 'get' magic.
-(A slightly shorter form is C<av_tindex>.)
+The Perl equivalent for these is C<$#av>.
+
+Use C<L</av_count>> to get the number of elements in an array.
=for apidoc av_len
Same as L</av_top_index>. Note that, unlike what the name implies, it returns
-the highest index in the array. This is unlike L</sv_len>, which returns what
+the maximum index in the array. This is unlike L</sv_len>, which returns what
you would expect.
B<To get the true number of elements in the array, instead use C<L</av_count>>>.