New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"splice() offset past end of array" warning doesn't always appear #12927
Comments
From @karenetheridgeAccording 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 Consider: This generates a warning on some versions/architectures and not others. warning: no warning: |
From @jkeenanOn Tue Apr 23 13:14:02 2013, perl@froods.org wrote:
Confirmed to occur in blead as well. |
The RT System itself - Status changed from 'new' to 'open' |
From @ikegamiIt's not a regression; it's an intentional change. C<< splice(@a, $n) >> is commonly used to truncate an array if it's too See So, this is merely a documentation bug for which I'll submit a patch - Eric On Tue, Apr 23, 2013 at 8:34 PM, James E Keenan via RT <
|
From @karenetheridgeOn 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 |
From @ikegamiOn Wed, Apr 24, 2013 at 10:47 AM, Karen Etheridge <perl@froods.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 @ikegami0001-Adjust-documentation-for-removal-of-splice-warning.patchFrom b4f8845653bc5261c5f8827c3edad6747396b651 Mon Sep 17 00:00:00 2001
From: Eric Brine <ikegami@adaelis.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 >> )
--
1.7.2.5
|
From @cpansproutOn Sun Jun 02 21:44:25 2013, ikegami@adaelis.com wrote:
Thank you. Applied as 8e602cc. -- Father Chrysostomos |
@cpansprout - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#117729 (status was 'resolved')
Searchable as RT117729$
The text was updated successfully, but these errors were encountered: