summaryrefslogtreecommitdiff
path: root/av.c
diff options
context:
space:
mode:
authorShlomi Fish <shlomif@iglu.org.il>2010-05-18 17:42:52 +0300
committerDavid Golden <dagolden@cpan.org>2010-05-25 12:15:01 -0400
commit1a32886282d60539000205670909069b85d9eedd (patch)
tree25756a907abdd3f0c418c38c163aeb2894c07812 /av.c
parentb7ff7ff211d0d5fc593efe5c9d305d197ecb8d86 (diff)
downloadperl-1a32886282d60539000205670909069b85d9eedd.tar.gz
Clarify the av_fetch() documentation.
Thanks to LeoNerd and Zefram on #p5p on IRC for some insights and suggesting versions for the modified text. I ended up using Zefram's version. Signed-off-by: David Golden <dagolden@cpan.org>
Diffstat (limited to 'av.c')
-rw-r--r--av.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/av.c b/av.c
index 33d5d7b6ff..06dc6066cd 100644
--- a/av.c
+++ b/av.c
@@ -191,12 +191,14 @@ Perl_av_extend(pTHX_ AV *av, I32 key)
=for apidoc av_fetch
Returns the SV at the specified index in the array. The C<key> is the
-index. If C<lval> is set then the fetch will be part of a store. Check
-that the return value is non-null before dereferencing it to a C<SV*>.
+index. If lval is true, you are guaranteed to get a real SV back (in case
+it wasn't real before), which you can then modify. Check that the return
+value is non-null before dereferencing it to a C<SV*>.
See L<perlguts/"Understanding the Magic of Tied Hashes and Arrays"> for
more information on how to use this function on tied arrays.
+The rough perl equivalent is C<$myarray[$idx]>.
=cut
*/