This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add a Perl equivalent to av_delete().
authorShlomi Fish <shlomif@iglu.org.il>
Sat, 15 May 2010 19:13:59 +0000 (22:13 +0300)
committerDavid Golden <dagolden@cpan.org>
Tue, 25 May 2010 16:15:01 +0000 (12:15 -0400)
Signed-off-by: David Golden <dagolden@cpan.org>
av.c

diff --git a/av.c b/av.c
index 095147a..f915fef 100644 (file)
--- a/av.c
+++ b/av.c
@@ -791,7 +791,9 @@ Perl_av_fill(pTHX_ register AV *av, I32 fill)
 
 Deletes the element indexed by C<key> from the array.  Returns the
 deleted element. If C<flags> equals C<G_DISCARD>, the element is freed
 
 Deletes the element indexed by C<key> from the array.  Returns the
 deleted element. If C<flags> equals C<G_DISCARD>, the element is freed
-and null is returned.
+and null is returned. Perl equivalent: C<my $elem = delete($myarray[$idx]);>
+for the non-C<G_DISCARD> version and a void-context C<delete($myarray[$idx]);>
+for the C<G_DISCARD> version.
 
 =cut
 */
 
 =cut
 */