diff options
author | Gisle Aas <gisle@aas.no> | 1998-06-24 17:11:35 +0200 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-06-28 19:23:40 +0000 |
commit | 48cdf507c2336254e1128c94e7b4ba57b106d9a9 (patch) | |
tree | 3a0b6379b40ab8efdf0c334e38849a4b809deb6e /pod | |
parent | 62f468fcc5ab60fb5a3476c4f51edf76066f5db7 (diff) | |
download | perl-48cdf507c2336254e1128c94e7b4ba57b106d9a9.tar.gz |
Negative LENGTH argument to splice
Message-ID: <m3g1gvc5bs.fsf@furu.g.aas.no>
p4raw-id: //depot/perl@1237
Diffstat (limited to 'pod')
-rw-r--r-- | pod/perlfunc.pod | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 909fa80ba6..089bd480fe 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -3336,11 +3336,13 @@ 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, returns the last element removed, or C<undef> if no elements are -removed. The array grows or shrinks as necessary. If LENGTH is -omitted, removes everything from OFFSET onward. The following -equivalences hold (assuming C<$[ == 0>): +removed. The array grows or shrinks as necessary. +If OFFSET is negative then it start 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. +The following equivalences hold (assuming C<$[ == 0>): - push(@a,$x,$y) splice(@a,$#a+1,0,$x,$y) + push(@a,$x,$y) splice(@a,@a,0,$x,$y) pop(@a) splice(@a,-1) shift(@a) splice(@a,0,1) unshift(@a,$x,$y) splice(@a,0,0,$x,$y) |