Closed p5pRT closed 11 years ago
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 splices at the end of the array.
Consider: perl -wle'use warnings FATAL => "all"; my @arr = qw(0 .. 10); splice(@arr\, 20); print "ar is @arr"'
This generates a warning on some versions/architectures and not others. Based on the versions tested\, this appears to have regressed between 5.14.3 and 5.16.0.
warning: 5.8.9 darwin OSX 10.6.8 5.14.2 darwin OSX 10.6.8 5.14.3 darwin OSX 10.6.8 5.14.3 linux CentOS
no warning: 5.16.0 linux ubuntu 5.16.0 darwin OSX 10.6.8 5.16.1 darwin OSX 10.6.8 5.16.3 darwin OSX 10.6.8 5.17.11 darwin OSX 10.6.8
On Tue Apr 23 13:14:02 2013\, perl@froods.org wrote:
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 splices at the end of the array.
Consider: perl -wle'use warnings FATAL => "all"; my @arr = qw(0 .. 10); splice(@arr\, 20); print "ar is @arr"'
This generates a warning on some versions/architectures and not others. Based on the versions tested\, this appears to have regressed between 5.14.3 and 5.16.0.
warning: 5.8.9 darwin OSX 10.6.8 5.14.2 darwin OSX 10.6.8 5.14.3 darwin OSX 10.6.8 5.14.3 linux CentOS
no warning: 5.16.0 linux ubuntu 5.16.0 darwin OSX 10.6.8 5.16.1 darwin OSX 10.6.8 5.16.3 darwin OSX 10.6.8 5.17.11 darwin OSX 10.6.8
Confirmed to occur in blead as well.
The RT System itself - Status changed from 'new' to 'open'
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 large\, so C\<\< splice(@a\, $n) >> (with no further args) does not warn even if @a\<$n.
See https://rt-archive.perl.org/perl5/Public/Bug/Display.html?id=78462 http://perl5.git.perl.org/perl.git/commitdiff/5cd408a276e19848774860967c3ec06b67b863ee?hp=0890f1a536cff0aff68038cae78e02c9d9b6a2b2
So\, this is merely a documentation bug for which I'll submit a patch tomorrow.
- Eric
On Tue\, Apr 23\, 2013 at 8:34 PM\, James E Keenan via RT \< perlbug-followup@perl.org> wrote:
On Tue Apr 23 13:14:02 2013\, perl@froods.org wrote:
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 splices at the end of the array.
Consider: perl -wle'use warnings FATAL => "all"; my @arr = qw(0 .. 10); splice(@arr\, 20); print "ar is @arr"'
This generates a warning on some versions/architectures and not others. Based on the versions tested\, this appears to have regressed between 5.14.3 and 5.16.0.
warning: 5.8.9 darwin OSX 10.6.8 5.14.2 darwin OSX 10.6.8 5.14.3 darwin OSX 10.6.8 5.14.3 linux CentOS
no warning: 5.16.0 linux ubuntu 5.16.0 darwin OSX 10.6.8 5.16.1 darwin OSX 10.6.8 5.16.3 darwin OSX 10.6.8 5.17.11 darwin OSX 10.6.8
Confirmed to occur in blead as well.
--- via perlbug: queue: perl5 status: new https://rt-archive.perl.org/perl5/Ticket/Display.html?id=117729
On Tue\, Apr 23\, 2013 at 09:52:07PM -0700\, Eric Brine via RT wrote:
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 large\, so C\<\< splice(@a\, $n) >> (with no further args) does not warn even if @a\<$n.
This is quite reasonable (and indeed\, this is the exact usecase where I discovered that there was a warning on my not-quite-as-current production system). :)
So\, this is merely a documentation bug for which I'll submit a patch tomorrow.
Thanks! (Was there also a perldelta entry for this? it's not too late to put one in perldelta5160.)
On Wed\, Apr 24\, 2013 at 10:47 AM\, Karen Etheridge \perl@​froods\.org wrote:
On Tue\, Apr 23\, 2013 at 09:52:07PM -0700\, Eric Brine via RT wrote:
So\, this is merely a documentation bug for which I'll submit a patch
tomorrow.
Thanks! (Was there also a perldelta entry for this? it's not too late to
put one in perldelta5160.)
Patched attached. Ok\, it's not "tomorrow"\, but I figured I'd wait til 5.18 was out.
It actually is too late to add to perldelta5160\, but it was actually mentioned.
On Sun Jun 02 21:44:25 2013\, ikegami@adaelis.com wrote:
On Wed\, Apr 24\, 2013 at 10:47 AM\, Karen Etheridge \perl@​froods\.org wrote:
On Tue\, Apr 23\, 2013 at 09:52:07PM -0700\, Eric Brine via RT wrote:
So\, this is merely a documentation bug for which I'll submit a patch
tomorrow.
Thanks! (Was there also a perldelta entry for this? it's not too late to
put one in perldelta5160.)
Patched attached. Ok\, it's not "tomorrow"\, but I figured I'd wait til 5.18 was out.
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$