develooper Front page | perl.perl5.porters | Postings from April 2013

Re: [perl #117729] "splice() offset past end of array" warning doesn't always appear

Thread Previous | Thread Next
From:
Karen Etheridge
Date:
April 24, 2013 14:47
Subject:
Re: [perl #117729] "splice() offset past end of array" warning doesn't always appear
Message ID:
20130424144728.GQ7526@tequila.etheridge.ca
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.)


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About