Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
"splice() offset past end of array" warning doesn't always appear #12927
According to the splice documentation in perlfunc:
splice ARRAY or EXPR,OFFSET
If OFFSET is past the end of the array, Perl issues a warning, and
This generates a warning on some versions/architectures and not others.
On Tue Apr 23 13:14:02 2013, email@example.com wrote:
Confirmed to occur in blead as well.
It's not a regression; it's an intentional change.
C<< splice(@a, $n) >> is commonly used to truncate an array if it's too
So, this is merely a documentation bug for which I'll submit a patch
On Tue, Apr 23, 2013 at 8:34 PM, James E Keenan via RT <
On Tue, Apr 23, 2013 at 09:52:07PM -0700, Eric Brine via RT wrote:
This is quite reasonable (and indeed, this is the exact usecase where I
Thanks! (Was there also a perldelta entry for this? it's not too late to
On Wed, Apr 24, 2013 at 10:47 AM, Karen Etheridge <firstname.lastname@example.org> wrote:
put one in perldelta5160.)
Patched attached. Ok, it's not "tomorrow", but I figured I'd wait til 5.18
It actually is too late to add to perldelta5160, but it was actually
From b4f8845653bc5261c5f8827c3edad6747396b651 Mon Sep 17 00:00:00 2001 From: Eric Brine <email@example.com> Date: Sun, 2 Jun 2013 21:46:07 -0700 Subject: [PATCH] Adjust documentation for removal of splice warning --- pod/perlfunc.pod | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 5c6b4f8..3b36873 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -6766,8 +6766,8 @@ If LENGTH is omitted, removes everything from OFFSET onward. If LENGTH is negative, removes the elements from OFFSET onward except for -LENGTH elements at the end of the array. If both OFFSET and LENGTH are omitted, removes everything. If OFFSET is -past the end of the array, Perl issues a warning, and splices at the -end of the array. +past the end of the array and a LENGTH was provided, Perl issues a warning, +and splices at the end of the array. The following equivalences hold (assuming C<< $#a >= $i >> ) -- 188.8.131.52
On Sun Jun 02 21:44:25 2013, firstname.lastname@example.org wrote:
Thank you. Applied as 8e602cc.