diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-02-19 17:35:50 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-02-19 17:35:50 +0000 |
commit | 453f904417cdcc40c685b37c28b80ff4c89a1c40 (patch) | |
tree | a3fae17649718c9c788e8215f117e109db2348b8 /pod/perlfunc.pod | |
parent | 1aeab75ab913b2442f1de7300d375422255ad122 (diff) | |
download | perl-453f904417cdcc40c685b37c28b80ff4c89a1c40.tar.gz |
document behavior of splice(@ary) (from Gisle Aas)
p4raw-id: //depot/perl@5152
Diffstat (limited to 'pod/perlfunc.pod')
-rw-r--r-- | pod/perlfunc.pod | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index d38424904b..578d62efcd 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -4182,6 +4182,8 @@ well-defined. =item splice ARRAY,OFFSET +=item splice ARRAY + Removes the elements designated by OFFSET and LENGTH from an array, and replaces them with the elements of LIST, if any. In list context, returns the elements removed from the array. In scalar context, @@ -4189,7 +4191,9 @@ returns the last element removed, or C<undef> if no elements are removed. The array grows or shrinks as necessary. If OFFSET is negative then it starts that far from the end of the array. If LENGTH is omitted, removes everything from OFFSET onward. -If LENGTH is negative, leave that many elements off the end of the array. +If LENGTH is negative, leaves that many elements off the end of the array. +If both OFFSET and LENGTH are omitted, removes everything. + The following equivalences hold (assuming C<$[ == 0>): push(@a,$x,$y) splice(@a,@a,0,$x,$y) |